File size: 394 Bytes
add0b21
c202414
add0b21
3dbbc2c
 
add0b21
c202414
3dbbc2c
 
add0b21
c202414
1
2
3
4
5
6
7
8
9
10
11
12
import gradio as gr
from transformers import pipeline

# Użyj modelu, który obsługuje generowanie tekstu
chatbot = pipeline("text-generation", model="microsoft/DialoGPT-medium")

def chat_with_bot(message):
    response = chatbot(message, max_length=50, num_return_sequences=1)
    return response[0]['generated_text']

gr.Interface(fn=chat_with_bot, inputs="text", outputs="text").launch()