Spaces:
Runtime error
Runtime error
bryantaekim
commited on
Commit
β’
7eb4bc9
1
Parent(s):
336e6ed
Update app.py
Browse files
app.py
CHANGED
@@ -3,14 +3,14 @@ from peft import PeftModel, PeftConfig
|
|
3 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
4 |
|
5 |
peft_model_id = f"bryantaekim/bk_text_to_ad"
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
|
15 |
# Load the Lora model
|
16 |
model = PeftModel.from_pretrained(model, peft_model_id)
|
|
|
3 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
4 |
|
5 |
peft_model_id = f"bryantaekim/bk_text_to_ad"
|
6 |
+
config = PeftConfig.from_pretrained(peft_model_id)
|
7 |
+
model = AutoModelForCausalLM.from_pretrained(
|
8 |
+
config.base_model_name_or_path,
|
9 |
+
return_dict=True,
|
10 |
+
load_in_8bit=True,
|
11 |
+
device_map="auto",
|
12 |
+
)
|
13 |
+
tokenizer = AutoTokenizer.from_pretrained(config.base_model_name_or_path)
|
14 |
|
15 |
# Load the Lora model
|
16 |
model = PeftModel.from_pretrained(model, peft_model_id)
|