Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -21,15 +21,15 @@ print(f"β
Model loaded successfully on {device}!")
|
|
| 21 |
# ==========================
|
| 22 |
# 2. Summarization function
|
| 23 |
# ==========================
|
| 24 |
-
def summarize_khmer_text(text, max_length=150
|
| 25 |
"""
|
| 26 |
Summarize Khmer text
|
| 27 |
"""
|
| 28 |
if not text or text.strip() == "":
|
| 29 |
return "β οΈ ααΌααααα
αΌαα’ααααα / Please enter text"
|
| 30 |
|
| 31 |
-
if len(text.strip()) < 20:
|
| 32 |
-
|
| 33 |
|
| 34 |
try:
|
| 35 |
# Tokenize input
|
|
|
|
| 21 |
# ==========================
|
| 22 |
# 2. Summarization function
|
| 23 |
# ==========================
|
| 24 |
+
def summarize_khmer_text(text, max_length=150):
|
| 25 |
"""
|
| 26 |
Summarize Khmer text
|
| 27 |
"""
|
| 28 |
if not text or text.strip() == "":
|
| 29 |
return "β οΈ ααΌααααα
αΌαα’ααααα / Please enter text"
|
| 30 |
|
| 31 |
+
# if len(text.strip()) < 20:
|
| 32 |
+
# return "β οΈ α’αααααααααΈααα / Text is too short to summarize"
|
| 33 |
|
| 34 |
try:
|
| 35 |
# Tokenize input
|