Spaces:
Runtime error
Runtime error
Commit
·
c1e05b4
1
Parent(s):
5754dc6
added llama 2 pipe
Browse files
app.py
CHANGED
@@ -1,7 +1,12 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
-
|
4 |
-
|
5 |
|
6 |
-
|
|
|
|
|
|
|
|
|
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()
|