Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -73,7 +73,8 @@ def app_interface():
|
|
| 73 |
|
| 74 |
task_dropdown = gr.Dropdown(list(tasks.keys()) + ["None"], label="Select a Task (Optional)", value="None")
|
| 75 |
|
| 76 |
-
input_text_box= gr.Textbox(label=
|
|
|
|
| 77 |
|
| 78 |
compute_button = gr.Button("Try🐣🛌🏻e5")
|
| 79 |
|
|
@@ -81,6 +82,7 @@ def app_interface():
|
|
| 81 |
|
| 82 |
with gr.Row():
|
| 83 |
with gr.Column():
|
|
|
|
| 84 |
input_text_box
|
| 85 |
with gr.Column():
|
| 86 |
compute_button
|
|
@@ -88,10 +90,16 @@ def app_interface():
|
|
| 88 |
|
| 89 |
compute_button.click(
|
| 90 |
fn=compute_embeddings,
|
| 91 |
-
inputs=[task_dropdown, input_text_box],
|
| 92 |
outputs=output_display
|
| 93 |
)
|
| 94 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
return demo
|
| 96 |
|
| 97 |
# Run the Gradio app
|
|
|
|
| 73 |
|
| 74 |
task_dropdown = gr.Dropdown(list(tasks.keys()) + ["None"], label="Select a Task (Optional)", value="None")
|
| 75 |
|
| 76 |
+
input_text_box = gr.Textbox(label="Input Text")
|
| 77 |
+
system_prompt_box = gr.Textbox(label="System Prompt (Optional)", visible=False) # Additional input for system prompt
|
| 78 |
|
| 79 |
compute_button = gr.Button("Try🐣🛌🏻e5")
|
| 80 |
|
|
|
|
| 82 |
|
| 83 |
with gr.Row():
|
| 84 |
with gr.Column():
|
| 85 |
+
system_prompt_box
|
| 86 |
input_text_box
|
| 87 |
with gr.Column():
|
| 88 |
compute_button
|
|
|
|
| 90 |
|
| 91 |
compute_button.click(
|
| 92 |
fn=compute_embeddings,
|
| 93 |
+
inputs=[task_dropdown, input_text_box, system_prompt_box],
|
| 94 |
outputs=output_display
|
| 95 |
)
|
| 96 |
|
| 97 |
+
task_dropdown.change(
|
| 98 |
+
fn=lambda task: {"visible": task == "None"},
|
| 99 |
+
inputs=task_dropdown,
|
| 100 |
+
outputs=system_prompt_box
|
| 101 |
+
)
|
| 102 |
+
|
| 103 |
return demo
|
| 104 |
|
| 105 |
# Run the Gradio app
|