Spaces:
Runtime error
Runtime error
Download app.py from developermaharshi/ECONOMIX: direct link, hf CLI and curl.
- Browser
- Download file 604 Bytes
-
https://huggingface.co/spaces/developermaharshi/ECONOMIX/resolve/main/app.py
- Command line
-
hf download hf://spaces/developermaharshi/ECONOMIX/app.py
-
curl -L -o app.py https://huggingface.co/spaces/developermaharshi/ECONOMIX/resolve/main/app.py
604 Bytes
| import gradio as gr | |
| from transformers import pipeline | |
| # Load AI model | |
| chatbot = pipeline("text-generation", model="mistralai/Mistral-7B-Instruct-v0.1") | |
| # Function to handle user questions | |
| def economix_chat(message): | |
| response = chatbot(message, max_length=200, do_sample=True) | |
| return response[0]['generated_text'] | |
| # Create the chatbot interface | |
| iface = gr.Interface( | |
| fn=economix_chat, | |
| inputs="text", | |
| outputs="text", | |
| title="ECONOMIX - AI Economics & Business Chatbot", | |
| description="Ask me anything about Economics, Business, or Finance!", | |
| ) | |
| # Launch chatbot | |
| iface.launch() | |