Update README.md
Browse files
README.md
CHANGED
@@ -10,4 +10,13 @@ from mamba_ssm.models.mixer_seq_simple import MambaLMHeadModel
|
|
10 |
model = MambaLMHeadModel.from_pretrained("Zyphra/Mamba-370M", iteration=10_000, device="cuda")
|
11 |
```
|
12 |
|
13 |
-
If iteration is not specified, then the model from the root of the repository is loaded, which is the final iteration (610,351).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
model = MambaLMHeadModel.from_pretrained("Zyphra/Mamba-370M", iteration=10_000, device="cuda")
|
11 |
```
|
12 |
|
13 |
+
If iteration is not specified, then the model from the root of the repository is loaded, which is the final iteration (610,351).
|
14 |
+
|
15 |
+
Here is a snippet for text generation:
|
16 |
+
```
|
17 |
+
import transformers, torch
|
18 |
+
tokenizer = transformers.AutoTokenizer.from_pretrained("EleutherAI/gpt-neox-20b")
|
19 |
+
inp_ids = torch.as_tensor([tokenizer.encode("Hello! How are you?")]).to("cuda")
|
20 |
+
out_ids = model.generate(inp_ids, max_length=100)
|
21 |
+
print(tokenizer.decode(out_ids[0]))
|
22 |
+
```
|