Spaces:
Sleeping
Sleeping
reduce processing time
Browse files
app.py
CHANGED
|
@@ -34,8 +34,9 @@ async def summarize(req: Request, body: SummarizeRequest):
|
|
| 34 |
# Tiền xử lý: nếu không giống tin tức thì thêm "Tin nhanh:"
|
| 35 |
if not text.lower().startswith(("theo", "trong khi", "bộ", "ngày", "việt nam", "công an")):
|
| 36 |
text = "Tin nhanh: " + text
|
| 37 |
-
else
|
| 38 |
-
text = "Vietnews: " + text
|
|
|
|
| 39 |
|
| 40 |
input_text = text + " </s>"
|
| 41 |
encoding = tokenizer(input_text, return_tensors="pt")
|
|
|
|
| 34 |
# Tiền xử lý: nếu không giống tin tức thì thêm "Tin nhanh:"
|
| 35 |
if not text.lower().startswith(("theo", "trong khi", "bộ", "ngày", "việt nam", "công an")):
|
| 36 |
text = "Tin nhanh: " + text
|
| 37 |
+
else:
|
| 38 |
+
text = "Vietnews: " + text
|
| 39 |
+
|
| 40 |
|
| 41 |
input_text = text + " </s>"
|
| 42 |
encoding = tokenizer(input_text, return_tensors="pt")
|