Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -33,7 +33,8 @@ def load_summarization_model(model_name):
|
|
33 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
34 |
config = AutoConfig.from_pretrained(model_name)
|
35 |
|
36 |
-
if
|
|
|
37 |
elif hasattr(config, 'n_positions'):
|
38 |
max_tokens = config.n_positions
|
39 |
elif hasattr(config, 'd_model'):
|
|
|
33 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
34 |
config = AutoConfig.from_pretrained(model_name)
|
35 |
|
36 |
+
if hasattr(config, 'max_position_embeddings'):
|
37 |
+
max_tokens = config.max_position_embeddings
|
38 |
elif hasattr(config, 'n_positions'):
|
39 |
max_tokens = config.n_positions
|
40 |
elif hasattr(config, 'd_model'):
|