Muhammadreza
commited on
Commit
•
99c57f3
1
Parent(s):
e43d459
Update README.md
Browse files
README.md
CHANGED
@@ -64,7 +64,7 @@ import torch
|
|
64 |
|
65 |
model_name_or_id = "MaralGPT/Maral-7B-alpha-1"
|
66 |
|
67 |
-
model = AutoModelForCausalLM.from_pretrained(model_name_or_id, torch_dtype=torch.
|
68 |
tokenizer = AutoTokenizer.from_pretrained(model_name_or_id)
|
69 |
|
70 |
prompt = "در سال ۱۹۹۶ چه کسی رییس جمهور آمریکا بود؟"
|
@@ -89,7 +89,7 @@ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
|
89 |
The code is pretty much the same as above, but with a slight diferrence.
|
90 |
|
91 |
* Make sure `bitsandbytes` is installed correctly.
|
92 |
-
* Your model loading must be `model = AutoModelForCausalLM.from_pretrained(model_name_or_id, load_in_8bit=True, torch_dtype=torch.
|
93 |
|
94 |
On _free version_ of Google Colab, you may face RAM problems. I guess using `low_cpu_mem_usage=True` in model loading would help.
|
95 |
|
|
|
64 |
|
65 |
model_name_or_id = "MaralGPT/Maral-7B-alpha-1"
|
66 |
|
67 |
+
model = AutoModelForCausalLM.from_pretrained(model_name_or_id, torch_dtype=torch.bfloat16, device_map="auto")
|
68 |
tokenizer = AutoTokenizer.from_pretrained(model_name_or_id)
|
69 |
|
70 |
prompt = "در سال ۱۹۹۶ چه کسی رییس جمهور آمریکا بود؟"
|
|
|
89 |
The code is pretty much the same as above, but with a slight diferrence.
|
90 |
|
91 |
* Make sure `bitsandbytes` is installed correctly.
|
92 |
+
* Your model loading must be `model = AutoModelForCausalLM.from_pretrained(model_name_or_id, load_in_8bit=True, torch_dtype=torch.bfloat16, device_map="auto")`
|
93 |
|
94 |
On _free version_ of Google Colab, you may face RAM problems. I guess using `low_cpu_mem_usage=True` in model loading would help.
|
95 |
|