Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -49,6 +49,7 @@ device = f'cuda:{cuda.current_device()}' if cuda.is_available() else 'cpu'
|
|
49 |
|
50 |
model_config = transformers.AutoConfig.from_pretrained(
|
51 |
model_id,
|
|
|
52 |
# use_auth_token=hf_auth
|
53 |
)
|
54 |
model = transformers.AutoModelForCausalLM.from_pretrained(
|
@@ -56,11 +57,13 @@ model = transformers.AutoModelForCausalLM.from_pretrained(
|
|
56 |
trust_remote_code=True,
|
57 |
config=model_config,
|
58 |
quantization_config=bnb_config,
|
|
|
59 |
# use_auth_token=hf_auth
|
60 |
)
|
61 |
model.eval()
|
62 |
tokenizer = transformers.AutoTokenizer.from_pretrained(
|
63 |
model_id,
|
|
|
64 |
# use_auth_token=hf_auth
|
65 |
)
|
66 |
generate_text = transformers.pipeline(
|
|
|
49 |
|
50 |
model_config = transformers.AutoConfig.from_pretrained(
|
51 |
model_id,
|
52 |
+
token=HF_TOKEN,
|
53 |
# use_auth_token=hf_auth
|
54 |
)
|
55 |
model = transformers.AutoModelForCausalLM.from_pretrained(
|
|
|
57 |
trust_remote_code=True,
|
58 |
config=model_config,
|
59 |
quantization_config=bnb_config,
|
60 |
+
token=HF_TOKEN,
|
61 |
# use_auth_token=hf_auth
|
62 |
)
|
63 |
model.eval()
|
64 |
tokenizer = transformers.AutoTokenizer.from_pretrained(
|
65 |
model_id,
|
66 |
+
token=HF_TOKEN,
|
67 |
# use_auth_token=hf_auth
|
68 |
)
|
69 |
generate_text = transformers.pipeline(
|