Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -40,17 +40,20 @@ def reset_history():
|
|
| 40 |
feedback_history = []
|
| 41 |
return "Feedback history has been reset."
|
| 42 |
|
| 43 |
-
# Set up
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
|
|
|
|
|
|
|
|
|
| 54 |
|
| 55 |
# Launch the app
|
| 56 |
app.launch()
|
|
|
|
| 40 |
feedback_history = []
|
| 41 |
return "Feedback history has been reset."
|
| 42 |
|
| 43 |
+
# Set up Gradio interface using Blocks
|
| 44 |
+
with gr.Blocks() as app:
|
| 45 |
+
gr.Markdown("# WriteBetter\nQuick feedback on tone, grammar, and word choice.")
|
| 46 |
+
input_text = gr.Textbox(lines=5, label="Your Writing", placeholder="Paste a short piece of creative writing here...")
|
| 47 |
+
feedback_output = gr.Textbox(label="Feedback")
|
| 48 |
+
reset_output = gr.Textbox(label="Reset Status", interactive=False)
|
| 49 |
+
|
| 50 |
+
# Generate feedback button
|
| 51 |
+
feedback_button = gr.Button("Generate Feedback")
|
| 52 |
+
feedback_button.click(fn=generate_unique_feedback, inputs=input_text, outputs=feedback_output)
|
| 53 |
+
|
| 54 |
+
# Reset history button
|
| 55 |
+
reset_button = gr.Button("Reset Feedback History")
|
| 56 |
+
reset_button.click(fn=reset_history, outputs=reset_output)
|
| 57 |
|
| 58 |
# Launch the app
|
| 59 |
app.launch()
|