Spaces:
Paused
Paused
Commit
·
9601f48
1
Parent(s):
1f8fbc2
trying to read token from the preset env
Browse files
model.py
CHANGED
@@ -9,6 +9,7 @@ from huggingface_hub import login
|
|
9 |
model_id = 'meta-llama/Llama-2-13b-chat-hf'
|
10 |
|
11 |
if torch.cuda.is_available():
|
|
|
12 |
tok = os.environ['HF_TOKEN']
|
13 |
login(new_session=True,
|
14 |
write_permission=False,
|
@@ -16,7 +17,7 @@ if torch.cuda.is_available():
|
|
16 |
|
17 |
#, token="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"
|
18 |
)
|
19 |
-
|
20 |
config = AutoConfig.from_pretrained(model_id,
|
21 |
use_auth_token=True)
|
22 |
config.pretraining_tp = 1
|
@@ -84,3 +85,8 @@ def run(message: str,
|
|
84 |
for text in streamer:
|
85 |
outputs.append(text)
|
86 |
yield ''.join(outputs)
|
|
|
|
|
|
|
|
|
|
|
|
9 |
model_id = 'meta-llama/Llama-2-13b-chat-hf'
|
10 |
|
11 |
if torch.cuda.is_available():
|
12 |
+
'''
|
13 |
tok = os.environ['HF_TOKEN']
|
14 |
login(new_session=True,
|
15 |
write_permission=False,
|
|
|
17 |
|
18 |
#, token="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"
|
19 |
)
|
20 |
+
'''
|
21 |
config = AutoConfig.from_pretrained(model_id,
|
22 |
use_auth_token=True)
|
23 |
config.pretraining_tp = 1
|
|
|
85 |
for text in streamer:
|
86 |
outputs.append(text)
|
87 |
yield ''.join(outputs)
|
88 |
+
|
89 |
+
'''
|
90 |
+
raise gr.Error(f'The accumulated input is too long ({input_token_length} > {MAX_INPUT_TOKEN_LENGTH}). Clear your chat history and try again.')
|
91 |
+
gradio.exceptions.Error: 'The accumulated input is too long (4191 > 4000). Clear your chat history and try again.'
|
92 |
+
'''
|