Spaces:
Sleeping
Sleeping
Nathan Slaughter
commited on
Commit
·
74d5c72
1
Parent(s):
f5b41ec
fix text input
Browse files- app/interface.py +2 -2
- app/processing.py +1 -1
app/interface.py
CHANGED
@@ -38,7 +38,7 @@ def create_interface():
|
|
38 |
# Define the Gradio interface function for Text Input
|
39 |
def handle_text_input(input_text, output_format):
|
40 |
try:
|
41 |
-
flashcards = process_text_input(input_text, output_format
|
42 |
return flashcards
|
43 |
except ValueError as ve:
|
44 |
return str(ve)
|
@@ -59,7 +59,7 @@ def create_interface():
|
|
59 |
format_selector = gr.Radio(
|
60 |
choices=["CSV", "JSON"],
|
61 |
label="Select Output Format",
|
62 |
-
value="
|
63 |
type="value"
|
64 |
)
|
65 |
submit_file = gr.Button("Extract Flashcards")
|
|
|
38 |
# Define the Gradio interface function for Text Input
|
39 |
def handle_text_input(input_text, output_format):
|
40 |
try:
|
41 |
+
flashcards = process_text_input(input_text, output_format)
|
42 |
return flashcards
|
43 |
except ValueError as ve:
|
44 |
return str(ve)
|
|
|
59 |
format_selector = gr.Radio(
|
60 |
choices=["CSV", "JSON"],
|
61 |
label="Select Output Format",
|
62 |
+
value="CSV",
|
63 |
type="value"
|
64 |
)
|
65 |
submit_file = gr.Button("Extract Flashcards")
|
app/processing.py
CHANGED
@@ -39,7 +39,7 @@ def process_file(file_obj, output_format: str, pipeline) -> str:
|
|
39 |
flashcards = pipeline.generate_flashcards(output_format, text)
|
40 |
return flashcards
|
41 |
|
42 |
-
def process_text_input(
|
43 |
"""
|
44 |
Processes the input text and extracts flashcards.
|
45 |
"""
|
|
|
39 |
flashcards = pipeline.generate_flashcards(output_format, text)
|
40 |
return flashcards
|
41 |
|
42 |
+
def process_text_input(input_text: str, output_format: str = "csv") -> str:
|
43 |
"""
|
44 |
Processes the input text and extracts flashcards.
|
45 |
"""
|