Spaces:
Paused
Paused
Tao Wu
commited on
Commit
·
f6aa47a
1
Parent(s):
2384367
fix bug
Browse files- app/embedding_setup.py +3 -4
app/embedding_setup.py
CHANGED
@@ -37,9 +37,7 @@ hf_auth = os.environ.get("SECRET_EXAMPLE")
|
|
37 |
|
38 |
|
39 |
tokenizer = AutoTokenizer.from_pretrained(LLM_MODEL, token=hf_auth, cache_dir="/hpcwork/vg380347/.cache")
|
40 |
-
|
41 |
-
LLM_MODEL, token=hf_auth, device_map="auto", trust_remote_code=True
|
42 |
-
)
|
43 |
|
44 |
first_token = 'First'
|
45 |
second_token = 'Second'
|
@@ -47,9 +45,10 @@ second_token = 'Second'
|
|
47 |
first_id = tokenizer.convert_tokens_to_ids(first_token)
|
48 |
second_id = tokenizer.convert_tokens_to_ids(second_token)
|
49 |
model = AutoModelForCausalLM.from_pretrained(
|
50 |
-
|
51 |
torch_dtype=torch.float16,
|
52 |
device_map="auto",
|
|
|
53 |
)
|
54 |
|
55 |
rec_adapter = PeftModel.from_pretrained(
|
|
|
37 |
|
38 |
|
39 |
tokenizer = AutoTokenizer.from_pretrained(LLM_MODEL, token=hf_auth, cache_dir="/hpcwork/vg380347/.cache")
|
40 |
+
|
|
|
|
|
41 |
|
42 |
first_token = 'First'
|
43 |
second_token = 'Second'
|
|
|
45 |
first_id = tokenizer.convert_tokens_to_ids(first_token)
|
46 |
second_id = tokenizer.convert_tokens_to_ids(second_token)
|
47 |
model = AutoModelForCausalLM.from_pretrained(
|
48 |
+
LLM_MODEL,
|
49 |
torch_dtype=torch.float16,
|
50 |
device_map="auto",
|
51 |
+
token=hf_auth,
|
52 |
)
|
53 |
|
54 |
rec_adapter = PeftModel.from_pretrained(
|