Brandon Royal
commited on
Commit
•
98d63bb
1
Parent(s):
044a024
cleanup readme
Browse files
README.md
CHANGED
@@ -95,22 +95,6 @@ outputs = model.generate(**input_ids)
|
|
95 |
print(tokenizer.decode(outputs[0]))
|
96 |
```
|
97 |
|
98 |
-
* _Using `torch.bfloat16`_
|
99 |
-
|
100 |
-
```python
|
101 |
-
# pip install accelerate
|
102 |
-
from transformers import AutoTokenizer, AutoModelForCausalLM
|
103 |
-
|
104 |
-
tokenizer = AutoTokenizer.from_pretrained("google/gemma-7b-AWQ")
|
105 |
-
model = AutoModelForCausalLM.from_pretrained("google/gemma-7b-AWQ", device_map="auto", torch_dtype=torch.bfloat16)
|
106 |
-
|
107 |
-
input_text = "Write me a poem about Machine Learning."
|
108 |
-
input_ids = tokenizer(input_text, return_tensors="pt").to("cuda")
|
109 |
-
|
110 |
-
outputs = model.generate(**input_ids)
|
111 |
-
print(tokenizer.decode(outputs[0]))
|
112 |
-
```
|
113 |
-
|
114 |
|
115 |
#### Other optimizations
|
116 |
|
|
|
95 |
print(tokenizer.decode(outputs[0]))
|
96 |
```
|
97 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
|
99 |
#### Other optimizations
|
100 |
|