Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -15,13 +15,14 @@ dtype = torch.bfloat16
|
|
15 |
quantization_config = BitsAndBytesConfig(load_in_8bit=True)
|
16 |
|
17 |
def load_model():
|
18 |
-
tokenizer = AutoTokenizer.from_pretrained(model_id,
|
19 |
model = AutoModelForCausalLM.from_pretrained(
|
20 |
model_id,
|
21 |
torch_dtype=dtype,
|
22 |
-
device_map=
|
23 |
quantization_config=quantization_config,
|
24 |
-
|
|
|
25 |
)
|
26 |
return tokenizer, model
|
27 |
|
|
|
15 |
quantization_config = BitsAndBytesConfig(load_in_8bit=True)
|
16 |
|
17 |
def load_model():
|
18 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id, token=huggingface_token)
|
19 |
model = AutoModelForCausalLM.from_pretrained(
|
20 |
model_id,
|
21 |
torch_dtype=dtype,
|
22 |
+
device_map="auto",
|
23 |
quantization_config=quantization_config,
|
24 |
+
token=huggingface_token,
|
25 |
+
low_cpu_mem_usage=True
|
26 |
)
|
27 |
return tokenizer, model
|
28 |
|