Spaces:
Runtime error

File size: 604 Bytes
667220d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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()