Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -75,14 +75,23 @@ def generate_conclusion(user_input, request: gr.Request):
|
|
| 75 |
except Exception as e:
|
| 76 |
return f"⚠️ An error occurred: {str(e)}"
|
| 77 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
# Gradio interface
|
| 79 |
-
demo = gr.Interface(
|
| 80 |
-
fn=generate_conclusion,
|
| 81 |
-
inputs=gr.Textbox(lines=4, placeholder="Enter your text here..."),
|
| 82 |
-
outputs="text",
|
| 83 |
-
title="Conclusion Generator Demo",
|
| 84 |
-
description="Generates a short conclusion from your input. Limited to 300 characters."
|
| 85 |
-
)
|
| 86 |
|
| 87 |
if __name__ == "__main__":
|
| 88 |
demo.queue(concurrency_limit=2, max_size=5).launch()
|
|
|
|
| 75 |
except Exception as e:
|
| 76 |
return f"⚠️ An error occurred: {str(e)}"
|
| 77 |
|
| 78 |
+
# Use Blocks instead of Interface
|
| 79 |
+
with gr.Blocks() as demo:
|
| 80 |
+
gr.Markdown("## Conclusion Generator Demo")
|
| 81 |
+
gr.Markdown("Generates a short conclusion from your input. Limited to 300 characters.")
|
| 82 |
+
input_box = gr.Textbox(lines=4, placeholder="Enter your text here...")
|
| 83 |
+
output_box = gr.Textbox()
|
| 84 |
+
submit_btn = gr.Button("Generate")
|
| 85 |
+
submit_btn.click(fn=generate_conclusion, inputs=input_box, outputs=output_box)
|
| 86 |
+
|
| 87 |
# Gradio interface
|
| 88 |
+
#demo = gr.Interface(
|
| 89 |
+
# fn=generate_conclusion,
|
| 90 |
+
# inputs=gr.Textbox(lines=4, placeholder="Enter your text here..."),
|
| 91 |
+
# outputs="text",
|
| 92 |
+
# title="Conclusion Generator Demo",
|
| 93 |
+
# description="Generates a short conclusion from your input. Limited to 300 characters."
|
| 94 |
+
#)
|
| 95 |
|
| 96 |
if __name__ == "__main__":
|
| 97 |
demo.queue(concurrency_limit=2, max_size=5).launch()
|