Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -13,9 +13,9 @@ loaded_tokenizer = AutoTokenizer.from_pretrained("runaksh/financial_summary_T5_b
|
|
13 |
# Function for generating summary
|
14 |
def generate_summary(text,min_length=55,max_length=80):
|
15 |
text = "summarize: "+text
|
16 |
-
input =
|
17 |
-
op=
|
18 |
-
decoded_op =
|
19 |
return decoded_op
|
20 |
|
21 |
title = "Financial News Summary"
|
|
|
13 |
# Function for generating summary
|
14 |
def generate_summary(text,min_length=55,max_length=80):
|
15 |
text = "summarize: "+text
|
16 |
+
input = loaded_tokenizer(text,max_length=512,truncation=True,return_tensors='tf').input_ids
|
17 |
+
op=loaded_model.generate(input,min_length=min_length,max_length=max_length)
|
18 |
+
decoded_op = loaded_tokenizer.batch_decode(op,skip_special_tokens=True)
|
19 |
return decoded_op
|
20 |
|
21 |
title = "Financial News Summary"
|