Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| from model_service import ask_ai | |
| def respond(user_input): | |
| if not user_input or not user_input.strip(): | |
| return "" | |
| return ask_ai(user_input) | |
| with gr.Blocks() as demo: | |
| gr.Markdown( | |
| """ | |
| # 🤖 Groq AI App | |
| **Powered by LLaMA 3.3 via Groq** | |
| Ask anything below 👇 | |
| """ | |
| ) | |
| user_input = gr.Textbox( | |
| label="Your Question", | |
| placeholder="Type your question here...", | |
| lines=2 | |
| ) | |
| output = gr.Textbox( | |
| label="AI Response", | |
| lines=6, | |
| interactive=False | |
| ) | |
| ask_btn = gr.Button("Ask", variant="primary") | |
| ask_btn.click( | |
| fn=respond, | |
| inputs=user_input, | |
| outputs=output | |
| ) | |
| demo.launch() | |