Update app.py
Browse files
app.py
CHANGED
@@ -143,8 +143,8 @@ def prompt_model(model_name, system_prompt, user_prompt, sql_context):
|
|
143 |
return result
|
144 |
|
145 |
def load_model(model_name):
|
146 |
-
|
147 |
-
|
148 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
149 |
tokenizer.pad_token = tokenizer.eos_token
|
150 |
|
|
|
143 |
return result
|
144 |
|
145 |
def load_model(model_name):
|
146 |
+
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto")
|
147 |
+
peft_model = PeftModel.from_pretrained(model, model_id=model_name, device_map="auto")
|
148 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
149 |
tokenizer.pad_token = tokenizer.eos_token
|
150 |
|