File size: 320 Bytes
9096781
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
import gradio as gr
from transformers import pipeline

# Load AI model (GPT-Neo)
chatbot = pipeline("text-generation", model="EleutherAI/gpt-neo-1.3B", device=-1)  # Runs on CPU

def chat(prompt):
    return chatbot(prompt)[0]['generated_text']

# Create UI
gr.Interface(fn=chat, inputs="text", outputs="text").launch()