Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -5,12 +5,16 @@ import json
|
|
5 |
import io
|
6 |
import os
|
7 |
from transformers import AutoTokenizer
|
8 |
-
|
|
|
|
|
|
|
9 |
|
10 |
region = os.getenv("region")
|
11 |
sm_endpoint_name = os.getenv("sm_endpoint_name")
|
12 |
access_key = os.getenv("access_key")
|
13 |
secret_key = os.getenv("secret_key")
|
|
|
14 |
|
15 |
session = boto3.Session(
|
16 |
aws_access_key_id=access_key,
|
@@ -26,8 +30,7 @@ DEFAULT_SYSTEM_PROMPT = (
|
|
26 |
)
|
27 |
|
28 |
# load the tokenizer
|
29 |
-
|
30 |
-
tokenizer = AutoTokenizer.from_pretrained("cszhzleo/Mistral-7B-Instruct-v0.2-nc2-bs1-token1024-neuron-218")
|
31 |
|
32 |
|
33 |
MAX_INPUT_TOKEN_LENGTH = 256
|
|
|
5 |
import io
|
6 |
import os
|
7 |
from transformers import AutoTokenizer
|
8 |
+
from huggingface_hub import login
|
9 |
+
|
10 |
+
hf_token=
|
11 |
+
login(token=hf_token)
|
12 |
|
13 |
region = os.getenv("region")
|
14 |
sm_endpoint_name = os.getenv("sm_endpoint_name")
|
15 |
access_key = os.getenv("access_key")
|
16 |
secret_key = os.getenv("secret_key")
|
17 |
+
hf_token=os.environ.get("HF_TOKEN")
|
18 |
|
19 |
session = boto3.Session(
|
20 |
aws_access_key_id=access_key,
|
|
|
30 |
)
|
31 |
|
32 |
# load the tokenizer
|
33 |
+
tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-Instruct-v0.2",token=hf_token)
|
|
|
34 |
|
35 |
|
36 |
MAX_INPUT_TOKEN_LENGTH = 256
|