Update README.md
Browse files
README.md
CHANGED
@@ -7,5 +7,37 @@ metrics:
|
|
7 |
base_model:
|
8 |
- meta-llama/Meta-Llama-3.1-8B-Instruct
|
9 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
## Evaluation Results
|
11 |
Zero-shot performance. Evaluated using select datasets from the [LM Evaluation Harness](https://github.com/EleutherAI/lm-evaluation-harness/tree/main) with additions:
|
|
|
7 |
base_model:
|
8 |
- meta-llama/Meta-Llama-3.1-8B-Instruct
|
9 |
---
|
10 |
+
## Usage
|
11 |
+
Support for this model will be added in the upcoming transformers release. In the meantime, please install the library from source:
|
12 |
+
'''
|
13 |
+
pip install transformers
|
14 |
+
|
15 |
+
'''
|
16 |
+
We can now run inference on this model:
|
17 |
+
'''
|
18 |
+
import torch
|
19 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
20 |
+
|
21 |
+
# Load the tokenizer and model
|
22 |
+
model_path = "nvidia/Mistral-NeMo-Minitron-8B-Base"
|
23 |
+
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
24 |
+
|
25 |
+
device = 'cuda'
|
26 |
+
dtype = torch.bfloat16
|
27 |
+
model = AutoModelForCausalLM.from_pretrained(model_path, torch_dtype=dtype, device_map=device)
|
28 |
+
|
29 |
+
# Prepare the input text
|
30 |
+
prompt = 'Complete the paragraph: our solar system is'
|
31 |
+
inputs = tokenizer.encode(prompt, return_tensors='pt').to(model.device)
|
32 |
+
|
33 |
+
# Generate the output
|
34 |
+
outputs = model.generate(inputs, max_length=20)
|
35 |
+
|
36 |
+
# Decode and print the output
|
37 |
+
output_text = tokenizer.decode(outputs[0])
|
38 |
+
print(output_text)
|
39 |
+
|
40 |
+
'''
|
41 |
+
|
42 |
## Evaluation Results
|
43 |
Zero-shot performance. Evaluated using select datasets from the [LM Evaluation Harness](https://github.com/EleutherAI/lm-evaluation-harness/tree/main) with additions:
|