Update app/summarizer.py
Browse files- app/summarizer.py +3 -3
app/summarizer.py
CHANGED
|
@@ -17,14 +17,14 @@ class TranslationRequest(BaseModel):
|
|
| 17 |
|
| 18 |
# Load tokenizer and model once during startup
|
| 19 |
try:
|
| 20 |
-
cache_dir = "./model_cache"
|
| 21 |
model_name = "facebook/bart-large-cnn"
|
| 22 |
|
| 23 |
print(f"Loading tokenizer from {model_name}...")
|
| 24 |
-
tokenizer = BartTokenizer.from_pretrained(model_name
|
| 25 |
|
| 26 |
print(f"Loading model from {model_name}...")
|
| 27 |
-
model = BartForConditionalGeneration.from_pretrained(model_name
|
| 28 |
|
| 29 |
print("Model and tokenizer loaded successfully!")
|
| 30 |
except Exception as e:
|
|
|
|
| 17 |
|
| 18 |
# Load tokenizer and model once during startup
|
| 19 |
try:
|
| 20 |
+
#cache_dir = "./model_cache"
|
| 21 |
model_name = "facebook/bart-large-cnn"
|
| 22 |
|
| 23 |
print(f"Loading tokenizer from {model_name}...")
|
| 24 |
+
tokenizer = BartTokenizer.from_pretrained(model_name)
|
| 25 |
|
| 26 |
print(f"Loading model from {model_name}...")
|
| 27 |
+
model = BartForConditionalGeneration.from_pretrained(model_name)
|
| 28 |
|
| 29 |
print("Model and tokenizer loaded successfully!")
|
| 30 |
except Exception as e:
|