abnerzhang commited on
Commit
fa6f33d
1 Parent(s): 9da3db2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -1
app.py CHANGED
@@ -1,10 +1,25 @@
1
  import gradio as gr
2
  from huggingface_hub import login
3
  import gradio_client as grc
 
 
 
 
 
 
 
 
 
 
4
  token = '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'
5
  login(token=token)
6
 
7
- gr.Interface.load("models/TinyPixel/Llama-2-7B-bf16-sharded").launch()
 
 
 
 
 
8
 
9
  # gr.Interface.load("models/abnerzhang/Llama-2-7B-bf16-sharded").launch()
10
  # grc.Client("ysharma/Explore_llamav2_with_TGI").deploy_discord(to_id="llama2-70b-discord-bot")
 
1
  import gradio as gr
2
  from huggingface_hub import login
3
  import gradio_client as grc
4
+ from transformers import pipeline
5
+
6
+
7
+ get_completion = pipeline("summarization", model="shleifer/distilbart-cnn-12-6")
8
+
9
+ def summarize(input):
10
+ output = get_completion(input)
11
+ return output[0]['summary_text']
12
+
13
+
14
  token = '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'
15
  login(token=token)
16
 
17
+
18
+ gr.close_all()
19
+ demo = gr.Interface(fn=summarize, inputs="text", outputs="text")
20
+ demo.launch()
21
+
22
+ # gr.Interface.load("models/TinyPixel/Llama-2-7B-bf16-sharded").launch()
23
 
24
  # gr.Interface.load("models/abnerzhang/Llama-2-7B-bf16-sharded").launch()
25
  # grc.Client("ysharma/Explore_llamav2_with_TGI").deploy_discord(to_id="llama2-70b-discord-bot")