Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
|
2 |
hf_token="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"
|
3 |
|
4 |
-
from transformers import
|
5 |
# from transformers.src.transformers import AutoModelForCausalLM, AutoTokenizer
|
6 |
|
7 |
model_id = "meta-llama/Llama-2-13b-chat-hf"
|
8 |
|
9 |
# load the model using 4bit quantization (https://huggingface.co/blog/4bit-transformers-bitsandbytes)
|
10 |
-
model =
|
11 |
# disable Tensor Parallelism (https://github.com/huggingface/transformers/pull/24906)
|
12 |
model.config.pretraining_tp=1
|
13 |
|
|
|
1 |
|
2 |
hf_token="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"
|
3 |
|
4 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
5 |
# from transformers.src.transformers import AutoModelForCausalLM, AutoTokenizer
|
6 |
|
7 |
model_id = "meta-llama/Llama-2-13b-chat-hf"
|
8 |
|
9 |
# load the model using 4bit quantization (https://huggingface.co/blog/4bit-transformers-bitsandbytes)
|
10 |
+
model = AutoModelForCausalLM.from_pretrained(model_id, load_in_4bit=True, use_auth_token=hf_token)
|
11 |
# disable Tensor Parallelism (https://github.com/huggingface/transformers/pull/24906)
|
12 |
model.config.pretraining_tp=1
|
13 |
|