Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ tokenizer = AutoTokenizer.from_pretrained("PRAli22/flan-t5-base-imdb-text-classi
|
|
7 |
|
8 |
|
9 |
|
10 |
-
def
|
11 |
inputs = tokenizer.encode_plus(text, padding='max_length', max_length=512, return_tensors='pt')
|
12 |
summarized_ids = model.generate(inputs['input_ids'], attention_mask=inputs['attention_mask'],
|
13 |
max_length=150, num_beams=4, early_stopping=True)
|
@@ -21,7 +21,7 @@ def sentimentt(text):
|
|
21 |
css_code='body{background-image:url("https://media.istockphoto.com/id/1256252051/vector/people-using-online-translation-app.jpg?s=612x612&w=0&k=20&c=aa6ykHXnSwqKu31fFR6r6Y1bYMS5FMAU9yHqwwylA94=");}'
|
22 |
|
23 |
demo = gr.Interface(
|
24 |
-
fn=
|
25 |
inputs=
|
26 |
gr.Textbox(label="text", placeholder="Enter the text "),
|
27 |
|
|
|
7 |
|
8 |
|
9 |
|
10 |
+
def summarize(text):
|
11 |
inputs = tokenizer.encode_plus(text, padding='max_length', max_length=512, return_tensors='pt')
|
12 |
summarized_ids = model.generate(inputs['input_ids'], attention_mask=inputs['attention_mask'],
|
13 |
max_length=150, num_beams=4, early_stopping=True)
|
|
|
21 |
css_code='body{background-image:url("https://media.istockphoto.com/id/1256252051/vector/people-using-online-translation-app.jpg?s=612x612&w=0&k=20&c=aa6ykHXnSwqKu31fFR6r6Y1bYMS5FMAU9yHqwwylA94=");}'
|
22 |
|
23 |
demo = gr.Interface(
|
24 |
+
fn=summarize,
|
25 |
inputs=
|
26 |
gr.Textbox(label="text", placeholder="Enter the text "),
|
27 |
|