lucas-w commited on
Commit
cf8456d
1 Parent(s): 8b5dc32

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -12
app.py CHANGED
@@ -1,16 +1,7 @@
1
- import gradio as gr
2
-
3
  from transformers import pipeline
 
4
 
5
- pipe = pipeline("chat", model="huggingface-projects/llama-2-7b-chat")
6
-
7
- def predict(text):
8
- return pipe(text)[0]["text"]
9
-
10
- demo = gr.Interface(
11
- fn=predict,
12
- inputs='text',
13
- outputs='text',
14
- )
15
 
 
16
  demo.launch()
 
 
 
1
  from transformers import pipeline
2
+ import gradio as gr
3
 
4
+ pipe = pipeline("translation", model="huggingface-projects/llama-2-7b-chat", token="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")
 
 
 
 
 
 
 
 
 
5
 
6
+ demo = gr.Interface.from_pipeline(pipe)
7
  demo.launch()