Commit
·
328d8e4
1
Parent(s):
c833359
Add README for Micro Llama v0 development
Browse files- Added a comprehensive README to describe the project, including an overview of Micro Llama v0, model specifications, file descriptions, and usage instructions.
- Provided installation steps and a sample Python script to load and test the model.
- Included licensing information under Apache 2.0 and details for contributing to the project.
README.md
CHANGED
@@ -1,3 +1,68 @@
|
|
1 |
---
|
2 |
license: apache-2.0
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: apache-2.0
|
3 |
---
|
4 |
+
|
5 |
+
# Micro Llama v0 (Development)
|
6 |
+
|
7 |
+
Micro Llama v0 is a lightweight and experimental version of the LlamaForCausalLM model designed for development and testing purposes. This repository contains the necessary model configuration, tokenizer, and generation settings to run a minimal Llama architecture.
|
8 |
+
|
9 |
+
## Model Overview
|
10 |
+
|
11 |
+
Micro Llama v0 is based on the LlamaForCausalLM architecture. It is tailored to fit resource-constrained environments for testing the foundational components of a transformer-based language model. This version features:
|
12 |
+
|
13 |
+
- **1 hidden layer**
|
14 |
+
- **2048 hidden size**
|
15 |
+
- **32 attention heads**
|
16 |
+
- **5632 intermediate size**
|
17 |
+
- **Max position embeddings** of 2048
|
18 |
+
- **Vocabulary size** of 32,000
|
19 |
+
|
20 |
+
These parameters make the model compact and suitable for development, while still maintaining key characteristics of the Llama architecture.
|
21 |
+
|
22 |
+
## Files and Configuration
|
23 |
+
|
24 |
+
- **`config.json`**: Contains the model architecture configuration, such as hidden size, number of attention heads, hidden layers, and activation functions.
|
25 |
+
- **`generation_config.json`**: Specifies generation parameters, including max length and token behavior.
|
26 |
+
- **`model.safetensors`**: Stores the model weights in a safe and efficient format.
|
27 |
+
- **`special_tokens_map.json`**: Maps the special tokens used by the model, including `<s>`, `</s>`, `<unk>`, and `</s>` (for padding).
|
28 |
+
- **`tokenizer.json`**: Defines the tokenizer configuration, including vocabulary size and token mapping.
|
29 |
+
- **`tokenizer_config.json`**: Further configures the tokenizer, specifying token types, maximum sequence length, and other tokenizer options.
|
30 |
+
|
31 |
+
## Requirements
|
32 |
+
|
33 |
+
- [Transformers](https://github.com/huggingface/transformers) version 4.44.0 or above
|
34 |
+
- PyTorch version compatible with the model's `float32` tensor type
|
35 |
+
- `safetensors` package for loading model weights
|
36 |
+
|
37 |
+
## Usage
|
38 |
+
|
39 |
+
1. Clone the repository:
|
40 |
+
```bash
|
41 |
+
git clone https://github.com/your-repo/micro-llama.git
|
42 |
+
cd micro-llama
|
43 |
+
```
|
44 |
+
2. Install the required dependencies:
|
45 |
+
```bash
|
46 |
+
pip install transformers safetensors torch
|
47 |
+
```
|
48 |
+
3. Load the model in your code:
|
49 |
+
```python
|
50 |
+
from transformers import LlamaForCausalLM, LlamaTokenizer
|
51 |
+
|
52 |
+
tokenizer = LlamaTokenizer.from_pretrained("UnieAI-Wilson/micro-llama-0-dev")
|
53 |
+
model = LlamaForCausalLM.from_pretrained("UnieAI-Wilson/micro-llama-0-dev", torch_dtype="float16")
|
54 |
+
|
55 |
+
inputs = tokenizer("Your text here", return_tensors="pt")
|
56 |
+
outputs = model.generate(**inputs)
|
57 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
58 |
+
```
|
59 |
+
## License
|
60 |
+
Micro Llama v0 is licensed under the Apache 2.0 License. See the LICENSE file for details.
|
61 |
+
|
62 |
+
## Contribution
|
63 |
+
|
64 |
+
This is an experimental and evolving project. Contributions are welcome, and feel free to submit issues or pull requests.
|
65 |
+
|
66 |
+
## Disclaimer
|
67 |
+
|
68 |
+
This is an early-stage development version, and the model may undergo significant changes. It is not intended for production use.
|