bstraehle commited on
Commit
160048e
1 Parent(s): 29ab405

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -129,9 +129,8 @@ def load_model(model_name):
129
  model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto")
130
  #tokenizer = AutoTokenizer.from_pretrained(model_name)
131
  tokenizer = model.tokenizer
132
-
133
- #if not tokenizer.pad_token:
134
- # tokenizer.pad_token = "[PAD]"
135
 
136
  return model, tokenizer
137
 
 
129
  model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto")
130
  #tokenizer = AutoTokenizer.from_pretrained(model_name)
131
  tokenizer = model.tokenizer
132
+
133
+ model.generation_config.pad_token_id = tokenizer.pad_token_id
 
134
 
135
  return model, tokenizer
136