jadechoghari
commited on
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
inference: false
|
3 |
+
library_name: transformers
|
4 |
+
language:
|
5 |
+
- en
|
6 |
+
- fr
|
7 |
+
- de
|
8 |
+
- es
|
9 |
+
- it
|
10 |
+
- pt
|
11 |
+
- ja
|
12 |
+
- ko
|
13 |
+
- zh
|
14 |
+
- ar
|
15 |
+
- el
|
16 |
+
- fa
|
17 |
+
- pl
|
18 |
+
- id
|
19 |
+
- cs
|
20 |
+
- he
|
21 |
+
- hi
|
22 |
+
- nl
|
23 |
+
- ro
|
24 |
+
- ru
|
25 |
+
- tr
|
26 |
+
- uk
|
27 |
+
- vi
|
28 |
+
license: cc-by-nc-4.0
|
29 |
+
# Making AI Models Faster, Smaller, and Cleaner! 🥝
|
30 |
+
|
31 |
+
**Contact me** if you have suggestions for models to compress next or if you want to compress your own models!
|
32 |
+
|
33 |
+
**Reduction:**
|
34 |
+
We reduced the Aya's size from 11 GB to 7GB, as well as reducing inference cost and gpu usage.
|
35 |
+
|
36 |
+
**How does the compression work?**
|
37 |
+
The model is compressed using Quanto to 8 bits.
|
38 |
+
|
39 |
+
**How does the model quality change?**
|
40 |
+
Quality might vary compared to the base model.
|
41 |
+
|
42 |
+
**How is the model efficiency evaluated?**
|
43 |
+
Results are based on testing with specific hardware and configurations. Efficiency may vary with different settings.
|
44 |
+
|
45 |
+
**What is the model format?**
|
46 |
+
We use safetensors.
|
47 |
+
|
48 |
+
**What calibration data was used?**
|
49 |
+
Calibration data includes WikiText, if needed by the compression method.
|
50 |
+
|
51 |
+
**How to compress your own models?**
|
52 |
+
Request access for more compression methods and support: [Request Access](#)
|
53 |
+
|
54 |
+
### About
|
55 |
+
Aya 23 is an open weights research release of an instruction fine-tuned model with highly advanced multilingual capabilities. Aya 23 focuses on pairing a highly performant pre-trained [Command family](https://huggingface.co/CohereForAI/c4ai-command-r-plus) of models with the recently released [Aya Collection](https://huggingface.co/datasets/CohereForAI/aya_collection). The result is a powerful multilingual large language model serving 23 languages.
|
56 |
+
|
57 |
+
This model card corresponds to the 8-billion version of the Aya 23 model. We also released a 35-billion version which you can find [here](https://huggingface.co/CohereForAI/aya-23-35B).
|
58 |
+
|
59 |
+
We cover 23 languages: Arabic, Chinese (simplified & traditional), Czech, Dutch, English, French, German, Greek, Hebrew, Hindi, Indonesian, Italian, Japanese, Korean, Persian, Polish, Portuguese, Romanian, Russian, Spanish, Turkish, Ukrainian, and Vietnamese
|
60 |
+
|
61 |
+
Developed by: [Cohere For AI](https://cohere.for.ai) and [Cohere](https://cohere.com/)
|
62 |
+
|
63 |
+
- Point of Contact: Cohere For AI: [cohere.for.ai](https://cohere.for.ai/)
|
64 |
+
- License: [CC-BY-NC](https://cohere.com/c4ai-cc-by-nc-license), requires also adhering to [C4AI's Acceptable Use Policy](https://docs.cohere.com/docs/c4ai-acceptable-use-policy)
|
65 |
+
- Model: aya-23-8B
|
66 |
+
- Model Size: 8 billion parameters
|
67 |
+
|
68 |
+
### Usage
|
69 |
+
|
70 |
+
Please install transformers from the source repository that includes the necessary changes for this model
|
71 |
+
|
72 |
+
```python
|
73 |
+
# pip install transformers==4.41.1
|
74 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
75 |
+
|
76 |
+
model_id = "CohereForAI/aya-23-8B"
|
77 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
78 |
+
model = AutoModelForCausalLM.from_pretrained(model_id)
|
79 |
+
|
80 |
+
# Format message with the command-r-plus chat template
|
81 |
+
messages = [{"role": "user", "content": "Anneme onu ne kadar sevdiğimi anlatan bir mektup yaz"}]
|
82 |
+
input_ids = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt")
|
83 |
+
## <BOS_TOKEN><|START_OF_TURN_TOKEN|><|USER_TOKEN|>Anneme onu ne kadar sevdiğimi anlatan bir mektup yaz<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>
|
84 |
+
|
85 |
+
gen_tokens = model.generate(
|
86 |
+
input_ids,
|
87 |
+
max_new_tokens=100,
|
88 |
+
do_sample=True,
|
89 |
+
temperature=0.3,
|
90 |
+
)
|
91 |
+
|
92 |
+
gen_text = tokenizer.decode(gen_tokens[0])
|
93 |
+
print(gen_text)
|
94 |
+
```
|
95 |
+
|
96 |
+
|
97 |
+
## Configurations
|
98 |
+
|
99 |
+
Configuration details are in `config.json`.
|
100 |
+
|
101 |
+
## Credits & License
|
102 |
+
|
103 |
+
The license of the model follows the original model’s license. Check the license of the base model for details.
|
104 |
+
|
105 |
+
**Want to suggest or compress other models?**
|
106 |
+
Send me a message!
|