Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -88,14 +88,16 @@ def load_model_and_tokenizer(doc_text_count):
|
|
| 88 |
# Load the pre-trained model with quantization
|
| 89 |
model = AutoModelForCausalLM.from_pretrained(
|
| 90 |
model_name,
|
| 91 |
-
|
| 92 |
-
model_max_length=1.3*round(doc_text_count * 0.3 + 1)
|
| 93 |
-
token=HF_TOKEN
|
| 94 |
)
|
| 95 |
|
| 96 |
# Load the tokenizer
|
| 97 |
tokenizer = AutoTokenizer.from_pretrained(
|
| 98 |
-
model_name
|
|
|
|
|
|
|
| 99 |
,token=HF_TOKEN
|
| 100 |
)
|
| 101 |
return tokenizer, model
|
|
|
|
| 88 |
# Load the pre-trained model with quantization
|
| 89 |
model = AutoModelForCausalLM.from_pretrained(
|
| 90 |
model_name,
|
| 91 |
+
trust_remote_code=True,
|
| 92 |
+
model_max_length=1.3*round(doc_text_count * 0.3 + 1)
|
| 93 |
+
,token=HF_TOKEN
|
| 94 |
)
|
| 95 |
|
| 96 |
# Load the tokenizer
|
| 97 |
tokenizer = AutoTokenizer.from_pretrained(
|
| 98 |
+
model_name,
|
| 99 |
+
trust_remote_code=True,
|
| 100 |
+
model_max_length=1.3*round(doc_text_count * 0.3 + 1)
|
| 101 |
,token=HF_TOKEN
|
| 102 |
)
|
| 103 |
return tokenizer, model
|