Spaces:
Sleeping
Sleeping
Download app/ui.py from abhojulius/CoachPlugin: direct link, hf CLI and curl.
- Browser
- Download file 922 Bytes
-
https://huggingface.co/spaces/abhojulius/CoachPlugin/resolve/main/app/ui.py
- Command line
-
hf download hf://spaces/abhojulius/CoachPlugin/app/ui.py
-
curl -L -o ui.py https://huggingface.co/spaces/abhojulius/CoachPlugin/resolve/main/app/ui.py
922 Bytes
| import gradio as gr | |
| from model import generate_response | |
| def chat_interface(user_message, context_prompt): | |
| # Kombinierter Prompt | |
| full_prompt = f"{context_prompt.strip()}\n\nUser: {user_message.strip()}" | |
| return generate_response(full_prompt) | |
| def create_ui(): | |
| with gr.Blocks() as demo: | |
| gr.Markdown("## 🤖 CoachConnect Chat") | |
| with gr.Row(): | |
| context = gr.Textbox(label="🎭 Kontext / Persona", value="Du bist ein erfahrener Mindset-Coach, der motiviert und ehrlich antwortet.") | |
| with gr.Row(): | |
| user_input = gr.Textbox(label="🗣️ Deine Nachricht") | |
| output = gr.Textbox(label="💬 Antwort") | |
| btn = gr.Button("Senden") | |
| btn.click(fn=chat_interface, inputs=[user_input, context], outputs=output) | |
| return demo | |
| # Wenn standalone ausgeführt | |
| if __name__ == "__main__": | |
| create_ui().launch(server_name="0.0.0.0", server_port=7860) | |