O S I H
commited on
Commit
•
0dfe54d
1
Parent(s):
79867a4
add trust remote code to token loading
Browse files
app.py
CHANGED
@@ -11,10 +11,6 @@ import spaces
|
|
11 |
import time
|
12 |
import subprocess
|
13 |
|
14 |
-
subprocess.run(
|
15 |
-
"pip uninstall -y transformers && pip install git+https://github.com/huggingface/transformers",
|
16 |
-
shell=True,
|
17 |
-
)
|
18 |
subprocess.run(
|
19 |
"pip install flash-attn --no-build-isolation",
|
20 |
env={"FLASH_ATTENTION_SKIP_CUDA_BUILD": "TRUE"},
|
@@ -27,11 +23,10 @@ token = os.environ["HF_TOKEN"]
|
|
27 |
|
28 |
model = AutoModelForCausalLM.from_pretrained(
|
29 |
"microsoft/Phi-3-small-8k-instruct",
|
30 |
-
# token=token,
|
31 |
torch_dtype="auto",
|
32 |
trust_remote_code=True,
|
33 |
)
|
34 |
-
tok = AutoTokenizer.from_pretrained("microsoft/Phi-3-small-8k-instruct")
|
35 |
terminators = [
|
36 |
tok.eos_token_id,
|
37 |
]
|
|
|
11 |
import time
|
12 |
import subprocess
|
13 |
|
|
|
|
|
|
|
|
|
14 |
subprocess.run(
|
15 |
"pip install flash-attn --no-build-isolation",
|
16 |
env={"FLASH_ATTENTION_SKIP_CUDA_BUILD": "TRUE"},
|
|
|
23 |
|
24 |
model = AutoModelForCausalLM.from_pretrained(
|
25 |
"microsoft/Phi-3-small-8k-instruct",
|
|
|
26 |
torch_dtype="auto",
|
27 |
trust_remote_code=True,
|
28 |
)
|
29 |
+
tok = AutoTokenizer.from_pretrained("microsoft/Phi-3-small-8k-instruct",trust_remote_code=True,)
|
30 |
terminators = [
|
31 |
tok.eos_token_id,
|
32 |
]
|