Spaces:
Runtime error
Runtime error
dhiraj5678
commited on
Commit
•
38aedae
1
Parent(s):
a111817
Create new file
Browse files
app.py
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
2 |
+
from io import StringIO
|
3 |
+
|
4 |
+
tokenizer = AutoTokenizer.from_pretrained("facebook/bart-large-cnn")
|
5 |
+
model = AutoModelForSeq2SeqLM.from_pretrained("facebook/bart-large-cnn")
|
6 |
+
|
7 |
+
import gradio as gr
|
8 |
+
|
9 |
+
def predict():
|
10 |
+
pass
|
11 |
+
|
12 |
+
description = "upload pdf file"
|
13 |
+
title = "Text Summarization from a pdf."
|
14 |
+
|
15 |
+
iface = gr.Interface(
|
16 |
+
|
17 |
+
fn =predict,
|
18 |
+
inputs = [
|
19 |
+
gr.inputs.File()],
|
20 |
+
|
21 |
+
outputs = [
|
22 |
+
gr.outputs.Carousel(['text']),
|
23 |
+
],
|
24 |
+
description=description,
|
25 |
+
title = title, allow_screenshot=False)
|
26 |
+
|
27 |
+
iface.launch(share = True,enable_queue=True, show_error =True)
|
28 |
+
|
29 |
+
|