Tony Pushmore commited on
Commit
6ac3795
1 Parent(s): 04e025d
Files changed (1) hide show
  1. app.py +19 -3
app.py CHANGED
@@ -1,7 +1,23 @@
1
  import gradio as gr
 
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
5
 
6
- demo = gr.Interface(fn=greet, inputs="text", outputs="text")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+