Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -59,23 +59,20 @@ def generate_answers(context):
|
|
59 |
|
60 |
# Function to display the form
|
61 |
def form_display():
|
62 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
|
64 |
# Function to submit the form
|
65 |
def form_submit(context):
|
66 |
generated_answers = generate_answers(context)
|
67 |
return generated_answers
|
68 |
|
69 |
-
# Create Gradio interface
|
70 |
-
iface = gr.Interface(
|
71 |
-
fn=form_submit,
|
72 |
-
inputs=gr.inputs.Textbox(label="Context", type="text", default=default_context, lines=20),
|
73 |
-
outputs=form_display(),
|
74 |
-
title="Dental Health Record Form with GPT-2",
|
75 |
-
description="Fill out the context and click submit to generate answers to the questions.",
|
76 |
-
examples=[default_context],
|
77 |
-
allow_flagging=False
|
78 |
-
)
|
79 |
-
|
80 |
# Launch the interface
|
81 |
-
|
|
|
59 |
|
60 |
# Function to display the form
|
61 |
def form_display():
|
62 |
+
return gr.Interface(
|
63 |
+
fn=form_submit,
|
64 |
+
inputs=gr.inputs.Textbox(lines=20, label="Context", default=default_context),
|
65 |
+
outputs=gr.outputs.Textbox(label="Generated Answers", type="text"),
|
66 |
+
title="Dental Health Record Form with GPT-2",
|
67 |
+
description="Fill out the context and click submit to generate answers to the questions.",
|
68 |
+
examples=[default_context],
|
69 |
+
allow_flagging=False
|
70 |
+
)
|
71 |
|
72 |
# Function to submit the form
|
73 |
def form_submit(context):
|
74 |
generated_answers = generate_answers(context)
|
75 |
return generated_answers
|
76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
# Launch the interface
|
78 |
+
form_display().launch()
|