ArkaAbacus
commited on
Commit
•
3e020a5
1
Parent(s):
93eb6eb
Update README.md
Browse files
README.md
CHANGED
@@ -29,6 +29,54 @@ We are conducting additional benchmark evaluations and will add those when avail
|
|
29 |
- **License:** https://llama.meta.com/llama3/license/
|
30 |
- **Finetuned from model:** [meta-llama/Meta-Llama-3-70B-Instruct](https://huggingface.co/meta-llama/Meta-Llama-3-70B-Instruct).
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
## Evaluation
|
34 |
|
|
|
29 |
- **License:** https://llama.meta.com/llama3/license/
|
30 |
- **Finetuned from model:** [meta-llama/Meta-Llama-3-70B-Instruct](https://huggingface.co/meta-llama/Meta-Llama-3-70B-Instruct).
|
31 |
|
32 |
+
## How to use
|
33 |
+
|
34 |
+
The prompt format is unchanged from Llama 3 70B Instruct.
|
35 |
+
|
36 |
+
### Use with transformers
|
37 |
+
|
38 |
+
See the snippet below for usage with Transformers:
|
39 |
+
|
40 |
+
```python
|
41 |
+
import transformers
|
42 |
+
import torch
|
43 |
+
|
44 |
+
model_id = "abacusai/Smaug-Llama-3-70B-Instruct"
|
45 |
+
|
46 |
+
pipeline = transformers.pipeline(
|
47 |
+
"text-generation",
|
48 |
+
model=model_id,
|
49 |
+
model_kwargs={"torch_dtype": torch.bfloat16},
|
50 |
+
device_map="auto",
|
51 |
+
)
|
52 |
+
|
53 |
+
messages = [
|
54 |
+
{"role": "system", "content": "You are a pirate chatbot who always responds in pirate speak!"},
|
55 |
+
{"role": "user", "content": "Who are you?"},
|
56 |
+
]
|
57 |
+
|
58 |
+
prompt = pipeline.tokenizer.apply_chat_template(
|
59 |
+
messages,
|
60 |
+
tokenize=False,
|
61 |
+
add_generation_prompt=True
|
62 |
+
)
|
63 |
+
|
64 |
+
terminators = [
|
65 |
+
pipeline.tokenizer.eos_token_id,
|
66 |
+
pipeline.tokenizer.convert_tokens_to_ids("<|eot_id|>")
|
67 |
+
]
|
68 |
+
|
69 |
+
outputs = pipeline(
|
70 |
+
prompt,
|
71 |
+
max_new_tokens=256,
|
72 |
+
eos_token_id=terminators,
|
73 |
+
do_sample=True,
|
74 |
+
temperature=0.6,
|
75 |
+
top_p=0.9,
|
76 |
+
)
|
77 |
+
print(outputs[0]["generated_text"][len(prompt):])
|
78 |
+
```
|
79 |
+
|
80 |
|
81 |
## Evaluation
|
82 |
|