Spaces:
Sleeping
Sleeping
app update
Browse files
app.py
CHANGED
|
@@ -122,9 +122,9 @@ def create_interface():
|
|
| 122 |
with gr.Blocks(title="Text Analysis App") as interface:
|
| 123 |
gr.Markdown("## Choose data format to analyze")
|
| 124 |
input_type = gr.Dropdown(["Text", "URL", "File"], label="Input Type")
|
| 125 |
-
text_input = gr.Textbox(
|
| 126 |
-
url_input = gr.Textbox(
|
| 127 |
-
file_input = gr.File(
|
| 128 |
|
| 129 |
tasks_checkboxes = gr.CheckboxGroup(["Summarization", "Sentiment Analysis", "Topic Detection"], label="Analysis Tasks")
|
| 130 |
|
|
@@ -146,11 +146,13 @@ def create_interface():
|
|
| 146 |
conversation_button = gr.Button("Send")
|
| 147 |
|
| 148 |
def update_input_visibility(input_type):
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
|
|
|
|
|
|
| 152 |
|
| 153 |
-
input_type.change(update_input_visibility, inputs=input_type)
|
| 154 |
|
| 155 |
def process_input(input_type, text, url, file, tasks):
|
| 156 |
if input_type == "Text":
|
|
|
|
| 122 |
with gr.Blocks(title="Text Analysis App") as interface:
|
| 123 |
gr.Markdown("## Choose data format to analyze")
|
| 124 |
input_type = gr.Dropdown(["Text", "URL", "File"], label="Input Type")
|
| 125 |
+
text_input = gr.Textbox(label="Text Input", visible=False)
|
| 126 |
+
url_input = gr.Textbox(label="URL Input", visible=False)
|
| 127 |
+
file_input = gr.File(label="File Upload", visible=False)
|
| 128 |
|
| 129 |
tasks_checkboxes = gr.CheckboxGroup(["Summarization", "Sentiment Analysis", "Topic Detection"], label="Analysis Tasks")
|
| 130 |
|
|
|
|
| 146 |
conversation_button = gr.Button("Send")
|
| 147 |
|
| 148 |
def update_input_visibility(input_type):
|
| 149 |
+
return {
|
| 150 |
+
text_input: gr.update(visible=input_type == "Text"),
|
| 151 |
+
url_input: gr.update(visible=input_type == "URL"),
|
| 152 |
+
file_input: gr.update(visible=input_type == "File")
|
| 153 |
+
}
|
| 154 |
|
| 155 |
+
input_type.change(update_input_visibility, inputs=[input_type], outputs=[text_input, url_input, file_input])
|
| 156 |
|
| 157 |
def process_input(input_type, text, url, file, tasks):
|
| 158 |
if input_type == "Text":
|