Spaces:
Runtime error
Runtime error
Commit
Β·
b214254
1
Parent(s):
fa55da5
Update app.py
Browse files
app.py
CHANGED
@@ -11,12 +11,10 @@ import torch
|
|
11 |
model_path = "leadingbridge/summarization"
|
12 |
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
13 |
model = T5ForConditionalGeneration.from_pretrained(model_path)
|
14 |
-
|
15 |
-
inputs = tokenizer.encode(text, return_tensors="pt")
|
16 |
-
summary_ids = model.generate(inputs)
|
17 |
-
summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
|
18 |
def summarize_text(text):
|
19 |
-
|
|
|
20 |
inputs = tokenizer.encode(text, return_tensors="pt")
|
21 |
# Generate the summary
|
22 |
summary_ids = model.generate(inputs)
|
|
|
11 |
model_path = "leadingbridge/summarization"
|
12 |
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
13 |
model = T5ForConditionalGeneration.from_pretrained(model_path)
|
14 |
+
|
|
|
|
|
|
|
15 |
def summarize_text(text):
|
16 |
+
text = "This is the initial testing text"
|
17 |
+
# Tokenize the input text
|
18 |
inputs = tokenizer.encode(text, return_tensors="pt")
|
19 |
# Generate the summary
|
20 |
summary_ids = model.generate(inputs)
|