Spaces:
Running
on
Zero
Running
on
Zero
Load model in bfloat16
#2
by
Rijgersberg
- opened
app.py
CHANGED
@@ -17,7 +17,7 @@ MAX_INPUT_TOKEN_LENGTH = int(os.getenv("MAX_INPUT_TOKEN_LENGTH", "8192"))
|
|
17 |
|
18 |
model_id = "BramVanroy/fietje-2b-chat"
|
19 |
avatar_url = "https://huggingface.co/spaces/BramVanroy/fietje-2b/resolve/main/img/fietje-2b-avatar.png"
|
20 |
-
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto")
|
21 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
22 |
tokenizer.pad_token_id = tokenizer.eos_token_id
|
23 |
|
|
|
17 |
|
18 |
model_id = "BramVanroy/fietje-2b-chat"
|
19 |
avatar_url = "https://huggingface.co/spaces/BramVanroy/fietje-2b/resolve/main/img/fietje-2b-avatar.png"
|
20 |
+
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16, device_map="auto")
|
21 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
22 |
tokenizer.pad_token_id = tokenizer.eos_token_id
|
23 |
|