lazarusrolando commited on
Commit
7198773
·
verified ·
1 Parent(s): 8b535b2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -4
app.py CHANGED
@@ -1,7 +1,26 @@
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
+ pipe = pipeline(
5
+ "text-generation",
6
+ model="lazarus19/OpenHusky"
7
+ )
8
 
9
+ def chat(message):
10
+ result = pipe(
11
+ message,
12
+ max_new_tokens=128,
13
+ do_sample=True,
14
+ temperature=0.7
15
+ )
16
+
17
+ return result[0]["generated_text"]
18
+
19
+ demo = gr.Interface(
20
+ fn=chat,
21
+ inputs=gr.Textbox(label="Message"),
22
+ outputs=gr.Textbox(label="Response"),
23
+ title="OpenHusky"
24
+ )
25
+
26
+ demo.launch()