Download app.py from Macut/maged-ai: direct link, hf CLI and curl.
- Browser
- Download file 598 Bytes
-
https://huggingface.co/spaces/Macut/maged-ai/resolve/main/app.py
- Command line
-
hf download hf://spaces/Macut/maged-ai/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Macut/maged-ai/resolve/main/app.py
598 Bytes
| import gradio as gr | |
| def chat_function(message, history): | |
| response = f"Hello! You said: {message} \nI am Maged AI ❤️" | |
| history = history + [(message, response)] | |
| return history, "" | |
| with gr.Blocks(title="Maged AI") as demo: | |
| gr.Markdown("# Maged AI - Your Smart Assistant 🤖") | |
| chatbot = gr.Chatbot(height=400) | |
| msg = gr.Textbox(placeholder="Type your message here...") | |
| clear = gr.Button("Clear") | |
| msg.submit(chat_function, [msg, chatbot], [chatbot, msg]) | |
| clear.click(lambda: ([], ""), None, [chatbot, msg]) | |
| demo.launch(server_name="0.0.0.0", server_port=7860) |