fiesty-bear commited on
Commit
c1e05b4
·
1 Parent(s): 5754dc6

added llama 2 pipe

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -1,7 +1,12 @@
1
  import gradio as gr
 
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
5
 
6
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
 
 
 
 
7
  iface.launch()
 
1
  import gradio as gr
2
+ from transformers import pipeline
3
 
4
+ # Use a pipeline as a high-level helper
5
+ pipe = pipeline("text-generation", model="meta-llama/Llama-2-7b-chat-hf")
6
 
7
+ def llama_chat(name):
8
+ resp = pipe(name)
9
+ return resp
10
+
11
+ iface = gr.Interface(fn=llama_chat, inputs="text", outputs="text")
12
  iface.launch()