Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -28,19 +28,21 @@ def generate_email(name, project, key_benefits):
|
|
28 |
return f"An error occurred: {str(e)}"
|
29 |
|
30 |
# Create Gradio interface
|
31 |
-
|
32 |
-
|
33 |
-
inputs
|
34 |
-
|
35 |
-
|
36 |
-
gr.
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
)
|
|
|
|
|
44 |
|
45 |
# Launch the app
|
46 |
-
|
|
|
28 |
return f"An error occurred: {str(e)}"
|
29 |
|
30 |
# Create Gradio interface
|
31 |
+
with gr.Blocks() as demo:
|
32 |
+
gr.Markdown("# Email Generator")
|
33 |
+
gr.Markdown("Generate a personalized email based on the given inputs.")
|
34 |
+
|
35 |
+
with gr.Row():
|
36 |
+
with gr.Column():
|
37 |
+
name = gr.Textbox(label="Your Name", placeholder="Enter your name")
|
38 |
+
project = gr.Textbox(label="Project Name", placeholder="Enter the project name")
|
39 |
+
benefits = gr.Textbox(label="Key Benefits", placeholder="List key benefits, separated by commas")
|
40 |
+
submit_btn = gr.Button("Generate Email")
|
41 |
+
|
42 |
+
with gr.Column():
|
43 |
+
output = gr.Textbox(label="Generated Email", lines=10)
|
44 |
+
|
45 |
+
submit_btn.click(generate_email, inputs=[name, project, benefits], outputs=output)
|
46 |
|
47 |
# Launch the app
|
48 |
+
demo.launch()
|