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

# Dùng mô hình pre-trained phù hợp trả lời tự nhiên
chatbot = pipeline("text-generation", model="microsoft/DialoGPT-medium")

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

gr.ChatInterface(fn=respond, title="Chatbot HR Quacontrol", theme="soft").launch()