Spaces:
Runtime error
Runtime error
Update app.py
Browse filesresolve padding issue
app.py
CHANGED
@@ -81,7 +81,11 @@ quantization_config = BitsAndBytesConfig(
|
|
81 |
)
|
82 |
|
83 |
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
|
84 |
-
|
|
|
|
|
|
|
|
|
85 |
MODEL_ID,
|
86 |
device_map="auto",
|
87 |
quantization_config=quantization_config,
|
|
|
81 |
)
|
82 |
|
83 |
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
|
84 |
+
# Set the pad token to be the same as the end of sequence token
|
85 |
+
if tokenizer.pad_token is None:
|
86 |
+
tokenizer.pad_token = tokenizer.eos_token
|
87 |
+
tokenizer.pad_token_id = tokenizer.eos_token_id
|
88 |
+
model = AutoModelForCausalLM.from_pretrained(
|
89 |
MODEL_ID,
|
90 |
device_map="auto",
|
91 |
quantization_config=quantization_config,
|