Spaces:
Runtime error
Runtime error
File size: 375 Bytes
911417c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
import gradio as gr
from transformers import pipeline
# Load a free LLM
chatbot = pipeline("text-generation", model="mistralai/Mistral-7B-Instruct-v0.1")
def chat(message):
response = chatbot(message, max_length=200)[0]["generated_text"]
return response
# Gradio Web Interface
demo = gr.Interface(fn=chat, inputs="text", outputs="text")
demo.launch()
|