HRDC / app.py
dunglc's picture
Update app.py
a6f4c8a verified
Raw
History Blame Contribute Delete
413 Bytes
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()