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()