File size: 711 Bytes
61e7052
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from transformers import pipeline
import gradio as gr


chatbot = pipeline("text-generation", model="deepseek-ai/DeepSeek-R1")

def chat_with_bot(user_input):
    # Generate a response from the chatbot model
    response = chatbot(user_input)
    return response[0]['generated_text'] 

interface = gr.Interface(
    fn=chat_with_bot,  # Function to call for processing the input
    inputs=gr.Textbox(label="Enter your message"),  # User input (text)
    outputs=gr.Textbox(label="Chatbot Response"),  # Model output (text)
    title="Chat with DeepSeek",  # Optional: Add a title to your interface
    description="Chat with an AI model powered by DeepSeek!"  # Optional: Add a description
)
interface.launch()