Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,12 @@
|
|
1 |
import gradio as gr
|
2 |
-
from transformers import pipeline
|
3 |
-
from
|
4 |
-
|
5 |
-
|
|
|
6 |
|
|
|
|
|
7 |
summarizer = pipeline("summarization", model="sumedh/t5-base-amazonreviews")
|
8 |
|
9 |
def texto_sum(text):
|
@@ -16,4 +19,4 @@ demo = gr.Interface(
|
|
16 |
outputs="text"
|
17 |
)
|
18 |
|
19 |
-
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
+
from transformers import pipeline, T5Tokenizer, T5ForConditionalGeneration
|
3 |
+
from google.colab import auth
|
4 |
+
auth.authenticate_user()
|
5 |
+
import os
|
6 |
+
token = os.getenv("HF_TOKEN")
|
7 |
|
8 |
+
tokenizer = T5Tokenizer.from_pretrained("sumedh/t5-base-amazonreviews", clean_up_tokenization_spaces=True)
|
9 |
+
model = T5ForConditionalGeneration.from_pretrained("sumedh/t5-base-amazonreviews")
|
10 |
summarizer = pipeline("summarization", model="sumedh/t5-base-amazonreviews")
|
11 |
|
12 |
def texto_sum(text):
|
|
|
19 |
outputs="text"
|
20 |
)
|
21 |
|
22 |
+
demo.launch()
|