Spaces:
Runtime error
Runtime error
Download app.py from Sibanjan/test_ui_generation: direct link, hf CLI and curl.
- Browser
- Download file 1.14 kB
-
https://huggingface.co/spaces/Sibanjan/test_ui_generation/resolve/main/app.py
- Command line
-
hf download hf://spaces/Sibanjan/test_ui_generation/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Sibanjan/test_ui_generation/resolve/main/app.py
1.14 kB
| import gradio as gr | |
| def generate_email(subject, description): | |
| # Placeholder function. Replace with your actual email generation logic. | |
| return f"Sample Email Body based on:\nSubject: {subject}\nDescription: {description}" | |
| iface = gr.Interface( | |
| fn=generate_email, | |
| inputs=[ | |
| gr.Textbox(label="Email Subject", placeholder="Type the subject here...", default="Sample Subject"), | |
| gr.Textbox(label="Brief Description", placeholder="Type a brief description of the email content here...", default="Sample description...", lines=3) | |
| ], | |
| outputs=gr.Textbox(label="Generated Email Body", default="Generated email content will appear here..."), | |
| title="AI Email Generation Tool", | |
| description="Enter a subject and a brief description to generate an email body. The AI model will craft an email based on your input.", | |
| theme="huggingface", | |
| layout="vertical", | |
| examples=[ | |
| ["Meeting Schedule", "Discuss the upcoming project meeting schedule and necessary preparations."], | |
| ["Product Inquiry", "Ask about the availability and specifications of the XYZ product."] | |
| ] | |
| ) | |
| iface.launch() |