Update app.py
Browse files
app.py
CHANGED
@@ -3,12 +3,12 @@ import torch
|
|
3 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, GenerationConfig
|
4 |
|
5 |
# Define the URL of your model on Hugging Face Spaces
|
6 |
-
|
7 |
|
8 |
# Load the model and tokenizer directly from the URL
|
9 |
try:
|
10 |
-
tokenizer = AutoTokenizer.from_pretrained(
|
11 |
-
model = AutoModelForSeq2SeqLM.from_pretrained(
|
12 |
except Exception as e:
|
13 |
st.error(f"Failed to load model: {e}")
|
14 |
|
|
|
3 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, GenerationConfig
|
4 |
|
5 |
# Define the URL of your model on Hugging Face Spaces
|
6 |
+
model_rpo = 'waqasali1707/Bart-Base-Summarization'
|
7 |
|
8 |
# Load the model and tokenizer directly from the URL
|
9 |
try:
|
10 |
+
tokenizer = AutoTokenizer.from_pretrained(model_rpo)
|
11 |
+
model = AutoModelForSeq2SeqLM.from_pretrained(model_rpo)
|
12 |
except Exception as e:
|
13 |
st.error(f"Failed to load model: {e}")
|
14 |
|