Luciferalive commited on
Commit
a028d89
1 Parent(s): 03122ad

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -11
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
- iface = gr.Interface(
39
- fn=get_model_response,
40
- inputs=[
41
- gr.inputs.Textbox(label="Input Text"),
42
- gr.inputs.Textbox(label="Instruction", default="Identify and summarize the core intent in the same language:"),
43
- ],
44
- outputs=gr.outputs.Textbox(label="Response"),
45
- title="Intent Summarization",
46
- description="Summarize the core intent of the input text in the same language.",
47
- )
48
 
49
- iface.launch()
 
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()