初始化项目,由ModelHub XC社区提供模型
Model: utter-project/EuroMoE-2.6B-A0.6B-Instruct-Preview Source: Original Platform
This commit is contained in:
52
.gitattributes
vendored
Normal file
52
.gitattributes
vendored
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.arrow filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bin filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ftz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.h5 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.joblib filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
|
||||||
|
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.onnx filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ot filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.parquet filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pb filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pt filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pth filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.rar filter=lfs diff=lfs merge=lfs -text
|
||||||
|
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tflite filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tfevents* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.db* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ark* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
**/*ckpt*data* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
**/*ckpt*.meta filter=lfs diff=lfs merge=lfs -text
|
||||||
|
**/*ckpt*.index filter=lfs diff=lfs merge=lfs -text
|
||||||
|
|
||||||
|
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.gguf* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ggml filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.llamafile* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pt2 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.npy filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.npz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pickle filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pkl filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tar filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.wasm filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zst filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
|
||||||
|
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
||||||
|
tokenizer.model filter=lfs diff=lfs merge=lfs -text
|
||||||
|
model-00001-of-00002.safetensors filter=lfs diff=lfs merge=lfs -text
|
||||||
|
model-00002-of-00002.safetensors filter=lfs diff=lfs merge=lfs -text
|
||||||
118
README.md
Normal file
118
README.md
Normal file
@@ -0,0 +1,118 @@
|
|||||||
|
---
|
||||||
|
license: apache-2.0
|
||||||
|
language:
|
||||||
|
- en
|
||||||
|
- de
|
||||||
|
- es
|
||||||
|
- fr
|
||||||
|
- it
|
||||||
|
- pt
|
||||||
|
- pl
|
||||||
|
- nl
|
||||||
|
- tr
|
||||||
|
- sv
|
||||||
|
- cs
|
||||||
|
- el
|
||||||
|
- hu
|
||||||
|
- ro
|
||||||
|
- fi
|
||||||
|
- uk
|
||||||
|
- sl
|
||||||
|
- sk
|
||||||
|
- da
|
||||||
|
- lt
|
||||||
|
- lv
|
||||||
|
- et
|
||||||
|
- bg
|
||||||
|
- 'no'
|
||||||
|
- ca
|
||||||
|
- hr
|
||||||
|
- ga
|
||||||
|
- mt
|
||||||
|
- gl
|
||||||
|
- zh
|
||||||
|
- ru
|
||||||
|
- ko
|
||||||
|
- ja
|
||||||
|
- ar
|
||||||
|
- hi
|
||||||
|
library_name: transformers
|
||||||
|
base_model:
|
||||||
|
- utter-project/EuroMoE-2.6B-A0.6B-Preview
|
||||||
|
---
|
||||||
|
|
||||||
|
# Model Card for EuroMoE-2.6B-A0.6B-Instruct-Preview
|
||||||
|
|
||||||
|
⚠️ PREVIEW RELEASE: This is a preview version of EuroMoE-2.6B-A0.6B-Instruct-Preview. The model is still under development and may have limitations in performance and stability. Use with caution in production environments.
|
||||||
|
|
||||||
|
This is the model card for EuroMoE-2.6B-A0.6B-Instruct-Preview. You can also check the pre-trained version: [EuroMoE-2.6B-A0.6B-Preview](https://huggingface.co/utter-project/EuroMoE-2.6B-A0.6B-Preview).
|
||||||
|
|
||||||
|
- **Developed by:** Unbabel, Instituto Superior Técnico, Instituto de Telecomunicações, University of Edinburgh, Aveni, University of Paris-Saclay, University of Amsterdam, Naver Labs, Sorbonne Université.
|
||||||
|
- **Funded by:** European Union.
|
||||||
|
- **Model type:** A 2.6B parameter multilingual transformer MoE with 0.6B active parameters.
|
||||||
|
- **Language(s) (NLP):** Bulgarian, Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, German, Greek, Hungarian, Irish, Italian, Latvian, Lithuanian, Maltese, Polish, Portuguese, Romanian, Slovak, Slovenian, Spanish, Swedish, Arabic, Catalan, Chinese, Galician, Hindi, Japanese, Korean, Norwegian, Russian, Turkish, and Ukrainian.
|
||||||
|
- **License:** Apache License 2.0.
|
||||||
|
|
||||||
|
## Model Details
|
||||||
|
|
||||||
|
The EuroLLM project has the goal of creating a suite of LLMs capable of understanding and generating text in all European Union languages as well as some additional relevant languages.
|
||||||
|
EuroMoE-2.6B-A0.6B is a 22B parameter model trained on 8 trillion tokens divided across the considered languages and several data sources: Web data, parallel data (en-xx and xx-en), and high-quality datasets.
|
||||||
|
EuroMoE-2.6B-A0.6B-Instruct was further instruction tuned on EuroBlocks, an instruction tuning dataset with focus on general instruction-following and machine translation.
|
||||||
|
|
||||||
|
|
||||||
|
### Model Description
|
||||||
|
|
||||||
|
EuroMoE uses a standard MoE Transformer architecture:
|
||||||
|
- We use grouped query attention (GQA) with 2 key-value heads, since it has been shown to increase speed at inference time while maintaining downstream performance.
|
||||||
|
- We perform pre-layer normalization, since it improves the training stability, and use the RMSNorm, which is faster.
|
||||||
|
- We use the SwiGLU activation function, since it has been shown to lead to good results on downstream tasks.
|
||||||
|
- We use rotary positional embeddings (RoPE) in every layer, since these have been shown to lead to good performances while allowing the extension of the context length.
|
||||||
|
|
||||||
|
For pre-training, we use 512 Nvidia A100 GPUs of the Leonardo supercomputer, training the model with a constant batch size of 4096 sequences, which corresponds to approximately 17 million tokens, using the Adam optimizer, and BF16 precision.
|
||||||
|
Here is a summary of the model hyper-parameters:
|
||||||
|
| | |
|
||||||
|
|--------------------------------------|----------------------|
|
||||||
|
| Sequence Length | 4,096 |
|
||||||
|
| Number of Layers | 24 |
|
||||||
|
| Embedding Size | 1,024 |
|
||||||
|
| Total/Active experts | 64/8 |
|
||||||
|
| Expert Hidden Size | 512 |
|
||||||
|
| Number of Heads | 8 |
|
||||||
|
| Number of KV Heads (GQA) | 2 |
|
||||||
|
| Activation Function | SwiGLU |
|
||||||
|
| Position Encodings | RoPE (\Theta=500,000) |
|
||||||
|
| Layer Norm | RMSNorm |
|
||||||
|
| Tied Embeddings | Yes |
|
||||||
|
| Embedding Parameters | 0.13B |
|
||||||
|
| LM Head Parameters | 0.13B |
|
||||||
|
| Active Non-embedding Parameters | 0.34B |
|
||||||
|
| Total Non-embedding Parameters | 2.35B |
|
||||||
|
| Active Parameters | 0.6B |
|
||||||
|
| Total Parameters | 2.61B |
|
||||||
|
|
||||||
|
## Run the model
|
||||||
|
|
||||||
|
from transformers import AutoModelForCausalLM, AutoTokenizer
|
||||||
|
|
||||||
|
model_id = "utter-project/EuroMoE-2.6B-A0.6B-Instruct-Preview"
|
||||||
|
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
||||||
|
model = AutoModelForCausalLM.from_pretrained(model_id)
|
||||||
|
|
||||||
|
messages = [
|
||||||
|
{
|
||||||
|
"role": "system",
|
||||||
|
"content": "You are EuroLLM --- an AI assistant specialized in European languages that provides safe, educational and helpful answers.",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role": "user", "content": "What is the capital of Portugal? How would you describe it?"
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
inputs = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt")
|
||||||
|
outputs = model.generate(inputs, max_new_tokens=1024)
|
||||||
|
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
||||||
|
|
||||||
|
|
||||||
|
## Bias, Risks, and Limitations
|
||||||
|
|
||||||
|
EuroMoE-2.6B-A0.6B-Instruct-Preview has not been aligned to human preferences, so the model may generate problematic outputs (e.g., hallucinations, harmful content, or false statements).
|
||||||
32
config.json
Normal file
32
config.json
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
{
|
||||||
|
"_name_or_path": "/mnt/cephfs-nvme/nunomg/axolotl/sft_ckpts/eurollm/EuroBlocks-500M-2.5B-MoE-200525-chatml-after-anneal",
|
||||||
|
"architectures": [
|
||||||
|
"MixtralForCausalLM"
|
||||||
|
],
|
||||||
|
"attention_dropout": 0.0,
|
||||||
|
"bos_token_id": 1,
|
||||||
|
"eos_token_id": 4,
|
||||||
|
"head_dim": 128,
|
||||||
|
"hidden_act": "silu",
|
||||||
|
"hidden_size": 1024,
|
||||||
|
"initializer_range": 0.02,
|
||||||
|
"intermediate_size": 512,
|
||||||
|
"max_position_embeddings": 4096,
|
||||||
|
"model_type": "mixtral",
|
||||||
|
"num_attention_heads": 8,
|
||||||
|
"num_experts_per_tok": 8,
|
||||||
|
"num_hidden_layers": 24,
|
||||||
|
"num_key_value_heads": 2,
|
||||||
|
"num_local_experts": 64,
|
||||||
|
"output_router_logits": false,
|
||||||
|
"rms_norm_eps": 1e-05,
|
||||||
|
"rope_theta": 500000,
|
||||||
|
"router_aux_loss_coef": 0.01,
|
||||||
|
"router_jitter_noise": 0.0,
|
||||||
|
"sliding_window": null,
|
||||||
|
"tie_word_embeddings": true,
|
||||||
|
"torch_dtype": "bfloat16",
|
||||||
|
"transformers_version": "4.46.1",
|
||||||
|
"use_cache": false,
|
||||||
|
"vocab_size": 128000
|
||||||
|
}
|
||||||
1
configuration.json
Normal file
1
configuration.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"framework": "pytorch", "task": "text-generation", "allow_remote": true}
|
||||||
7
generation_config.json
Normal file
7
generation_config.json
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"_from_model_config": true,
|
||||||
|
"bos_token_id": 1,
|
||||||
|
"do_sample": true,
|
||||||
|
"eos_token_id": 2,
|
||||||
|
"transformers_version": "4.46.1"
|
||||||
|
}
|
||||||
3
model-00001-of-00002.safetensors
Normal file
3
model-00001-of-00002.safetensors
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:dffaff23a9e5e58a8dd19745cbdcf22095f4e7f28d6183d08b009221ab22dc5e
|
||||||
|
size 5000160568
|
||||||
3
model-00002-of-00002.safetensors
Normal file
3
model-00002-of-00002.safetensors
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:2f23d9076af7abad027cd092a9a19c140dd6fd9cfb0315c1612f7c400b171f03
|
||||||
|
size 223515752
|
||||||
4785
model.safetensors.index.json
Normal file
4785
model.safetensors.index.json
Normal file
File diff suppressed because it is too large
Load Diff
30
special_tokens_map.json
Normal file
30
special_tokens_map.json
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"bos_token": {
|
||||||
|
"content": "<s>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": false,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
},
|
||||||
|
"eos_token": {
|
||||||
|
"content": "<|im_end|>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": false,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
},
|
||||||
|
"pad_token": {
|
||||||
|
"content": "</s>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": false,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
},
|
||||||
|
"unk_token": {
|
||||||
|
"content": "<unk>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": false,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
}
|
||||||
|
}
|
||||||
3
tokenizer.json
Normal file
3
tokenizer.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:d6e4810e827e4ffcd735429d19d585326bb4efb31e921cb870ecefc4c1fa16e3
|
||||||
|
size 15783507
|
||||||
3
tokenizer.model
Normal file
3
tokenizer.model
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:42957aec88804838805b335da1bbcce9d116024a20c6c4b56757648b9e348254
|
||||||
|
size 2408875
|
||||||
2108
tokenizer_config.json
Normal file
2108
tokenizer_config.json
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user