geo / app.py
Tony Pushmore
ffs
6ac3795
raw
history blame contribute delete
650 Bytes
import gradio as gr
from transformers import pipeline
# Initialize the text-generation pipeline with the Georgian model
pipe = pipeline("text-generation", model="ai-forever/mGPT-1.3B-georgian")
# Define a function that will handle user input and generate a response
def chatbot(input_text):
response = pipe(input_text, max_length=50, num_return_sequences=1)
return response[0]["generated_text"]
# Create the Gradio interface
demo = gr.Interface(
fn=chatbot,
inputs="text",
outputs="text",
title="Georgian Chatbot",
description="This is a chatbot powered by mGPT-1.3B-georgian model."
)
# Launch the app
demo.launch()