arpm01 commited on
Commit
f345836
·
1 Parent(s): 3a2bd0c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -6
app.py CHANGED
@@ -1,10 +1,14 @@
1
  import gradio as gr
2
- from transformers import pipeline
3
 
4
- pipe = pipeline(task="image-classification",
5
- # model that can do 22k-category classification
6
- model="microsoft/beit-base-patch16-224-pt22k-ft22k")
 
 
 
 
7
  gr.Interface.from_pipeline(pipe,
8
- title="22k Image Classification",
9
- description="Object Recognition using Microsoft BEIT",
10
  allow_flagging="never").launch(inbrowser=True)
 
1
  import gradio as gr
2
+ from transformers import pipeline, AutoTokenizer, AutoModelForSeq2SeqLM
3
 
4
+ tokenizer = AutoTokenizer.from_pretrained("google/pegasus-xsum")
5
+
6
+ model = AutoModelForSeq2SeqLM.from_pretrained("google/pegasus-xsum")
7
+
8
+ pipe = pipeline(task="summarization",
9
+ model=model,
10
+ tokenizer=tokenizer)
11
  gr.Interface.from_pipeline(pipe,
12
+ title="Summarization using pegasus",
13
+ description="Summarization description",
14
  allow_flagging="never").launch(inbrowser=True)