Update app.py
Browse files
app.py
CHANGED
|
@@ -28,8 +28,8 @@ except OSError:
|
|
| 28 |
model_name = "kritsadaK/bart-financial-summarization"
|
| 29 |
try:
|
| 30 |
print(f"Attempting to load Hugging Face model: {model_name}")
|
| 31 |
-
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 32 |
-
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
|
| 33 |
summarizer = pipeline("summarization", model=model, tokenizer=tokenizer)
|
| 34 |
print("Hugging Face model loaded successfully!")
|
| 35 |
except Exception as e:
|
|
|
|
| 28 |
model_name = "kritsadaK/bart-financial-summarization"
|
| 29 |
try:
|
| 30 |
print(f"Attempting to load Hugging Face model: {model_name}")
|
| 31 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
| 32 |
+
model = AutoModelForSeq2SeqLM.from_pretrained(model_name, trust_remote_code=True)
|
| 33 |
summarizer = pipeline("summarization", model=model, tokenizer=tokenizer)
|
| 34 |
print("Hugging Face model loaded successfully!")
|
| 35 |
except Exception as e:
|