Update README.md
Browse files
README.md
CHANGED
@@ -5,67 +5,38 @@ language:
|
|
5 |
pipeline_tag: text-generation
|
6 |
---
|
7 |
# Llama-3-2B-Base
|
8 |
-
A slimmed-down, third-party adaptation of the Llama 3 model with only 2 billion parameters.
|
9 |
|
10 |
-
|
11 |
-
|
12 |
-
|
|
|
13 |
|
14 |
-
|
15 |
-
Llama-3-2B-Base is a reduced version of the popular Llama 3 models, specifically designed to bring the power of LLMs (Large Language Models) to environments with limited computational resources. This model offers a balance between performance and resource usage, serving as an efficient alternative for users who cannot leverage the larger, resource-intensive versions from Meta.
|
16 |
|
17 |
-
##
|
18 |
-
This version has been developed independently and is not associated with Meta.
|
19 |
|
20 |
-
|
21 |
-
- **Input**: Text only.
|
22 |
-
- **Output**: Generates text and code only.
|
23 |
|
24 |
-
|
25 |
-
|
|
|
|
|
|
|
26 |
|
27 |
-
##
|
28 |
-
- **Use Cases**: Suitable for both commercial and research use in English, capable of assistant-like chat and a variety of natural language generation tasks.
|
29 |
-
- **Out-of-Scope**: Any use that violates applicable laws or regulations (including trade compliance laws), or the Acceptable Use Policy.
|
30 |
|
31 |
-
|
|
|
|
|
|
|
32 |
|
33 |
-
|
34 |
-
You can leverage the `transformers` library to run inference.
|
35 |
|
36 |
-
|
37 |
|
38 |
```python
|
39 |
-
import
|
40 |
-
import torch
|
41 |
-
|
42 |
-
model_id = "andrijdavid/Llama-3-2B-Base"
|
43 |
-
pipeline = transformers.pipeline(
|
44 |
-
"text-generation", model=model_id,
|
45 |
-
model_kwargs={"torch_dtype": torch.bfloat16},
|
46 |
-
device_map="auto"
|
47 |
-
)
|
48 |
-
|
49 |
-
messages = [
|
50 |
-
{"role": "system", "content": "You are a pirate chatbot who always responds in pirate speak!"},
|
51 |
-
{"role": "user", "content": "Who are you?"}
|
52 |
-
]
|
53 |
-
|
54 |
-
terminators = [
|
55 |
-
pipeline.tokenizer.eos_token_id,
|
56 |
-
pipeline.tokenizer.convert_tokens_to_ids("<|eot_id|>")
|
57 |
-
]
|
58 |
-
|
59 |
-
outputs = pipeline(
|
60 |
-
messages, max_new_tokens=256,
|
61 |
-
eos_token_id=terminators,
|
62 |
-
do_sample=True, temperature=0.6, top_p=0.9
|
63 |
-
)
|
64 |
-
print(outputs[0]["generated_text"][-1])
|
65 |
-
```
|
66 |
-
|
67 |
-
## Hardware and Software Considerations
|
68 |
-
Llama-3-2B is designed to run efficiently on mid-tier hardware, significantly lowering the entry barrier for using advanced language models.
|
69 |
|
70 |
-
|
71 |
-
Llama-3-2B
|
|
|
|
5 |
pipeline_tag: text-generation
|
6 |
---
|
7 |
# Llama-3-2B-Base
|
|
|
8 |
|
9 |
+
Llama3-2b is a trimmed version of the official (Llama-3 8B)[https://huggingface.co/meta-llama/Meta-Llama-3-8B] base model from (Meta)[https://huggingface.co/meta-llama].
|
10 |
+
It has been reduced in size to ~2 billion parameters, making it more computationally efficient while still retaining a significant portion of the original model's capabilities.
|
11 |
+
This model is intended to serve as a base model and has not been further fine-tuned for any specific task.
|
12 |
+
It is specifically designed to bring the power of LLMs (Large Language Models) to environments with limited computational resources. This model offers a balance between performance and resource usage, serving as an efficient alternative for users who cannot leverage the larger, resource-intensive versions from Meta.
|
13 |
|
14 |
+
**Important**: This project is not affiliated with Meta.
|
|
|
15 |
|
16 |
+
## Uses
|
|
|
17 |
|
18 |
+
This model can be fine-tuned for a variety of natural language processing tasks, including:
|
|
|
|
|
19 |
|
20 |
+
- Text generation
|
21 |
+
- Question answering
|
22 |
+
- Sentiment analysis
|
23 |
+
- Translation
|
24 |
+
- Summarization
|
25 |
|
26 |
+
## Bias, Risks, and Limitations
|
|
|
|
|
27 |
|
28 |
+
While Llama3-2b is a powerful model, it is important to be aware of its limitations and potential biases.
|
29 |
+
As with any language model, this model may generate outputs that are factually incorrect or biased.
|
30 |
+
It is also possible that the model may produce offensive or inappropriate content.
|
31 |
+
Users and Developers should be aware of these risks and take appropriate measures to mitigate them.
|
32 |
|
33 |
+
## How to Use
|
|
|
34 |
|
35 |
+
To use Llama3-2b, you can load the model using the Hugging Face Transformers library in Python:
|
36 |
|
37 |
```python
|
38 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
|
40 |
+
tokenizer = AutoTokenizer.from_pretrained("andrijdavid/Llama-3-2B-Base/")
|
41 |
+
model = AutoModelForCausalLM.from_pretrained("andrijdavid/Llama-3-2B-Base/")
|
42 |
+
```
|