Tony Pushmore
commited on
Commit
•
6ac3795
1
Parent(s):
04e025d
ffs
Browse files
app.py
CHANGED
@@ -1,7 +1,23 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
-
|
4 |
-
|
5 |
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
demo.launch()
|
|
|
|
1 |
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
|
4 |
+
# Initialize the text-generation pipeline with the Georgian model
|
5 |
+
pipe = pipeline("text-generation", model="ai-forever/mGPT-1.3B-georgian")
|
6 |
|
7 |
+
# Define a function that will handle user input and generate a response
|
8 |
+
def chatbot(input_text):
|
9 |
+
response = pipe(input_text, max_length=50, num_return_sequences=1)
|
10 |
+
return response[0]["generated_text"]
|
11 |
+
|
12 |
+
# Create the Gradio interface
|
13 |
+
demo = gr.Interface(
|
14 |
+
fn=chatbot,
|
15 |
+
inputs="text",
|
16 |
+
outputs="text",
|
17 |
+
title="Georgian Chatbot",
|
18 |
+
description="This is a chatbot powered by mGPT-1.3B-georgian model."
|
19 |
+
)
|
20 |
+
|
21 |
+
# Launch the app
|
22 |
demo.launch()
|
23 |
+
|