Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -35,15 +35,13 @@ def get_model_response(user_input, instruction="Identify and summarize the core
|
|
| 35 |
return response.split("### Response:")[-1].strip()
|
| 36 |
|
| 37 |
# Gradio interface
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
description="Summarize the core intent of the input text in the same language.",
|
| 47 |
-
)
|
| 48 |
|
| 49 |
-
|
|
|
|
| 35 |
return response.split("### Response:")[-1].strip()
|
| 36 |
|
| 37 |
# Gradio interface
|
| 38 |
+
with gr.Blocks() as demo:
|
| 39 |
+
with gr.Row():
|
| 40 |
+
with gr.Column():
|
| 41 |
+
input_text = gr.Textbox(label="Input Text")
|
| 42 |
+
instruction = gr.Textbox(label="Instruction", value="Identify and summarize the core intent in the same language:")
|
| 43 |
+
output_text = gr.Textbox(label="Response")
|
| 44 |
+
input_btn = gr.Button("Submit")
|
| 45 |
+
input_btn.click(get_model_response, inputs=[input_text, instruction], outputs=output_text)
|
|
|
|
|
|
|
| 46 |
|
| 47 |
+
demo.launch()
|