初始化项目,由ModelHub XC社区提供模型
Model: OvercastLab/Quark-50m Source: Original Platform
This commit is contained in:
35
.gitattributes
vendored
Normal file
35
.gitattributes
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.arrow filter=lfs diff=lfs merge=lfs -text
|
||||
*.bin filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.ckpt 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
|
||||
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
||||
*.model filter=lfs diff=lfs merge=lfs -text
|
||||
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
||||
*.npy filter=lfs diff=lfs merge=lfs -text
|
||||
*.npz 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
|
||||
*.pickle filter=lfs diff=lfs merge=lfs -text
|
||||
*.pkl 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
|
||||
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
||||
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
||||
*.tar.* 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
|
||||
*.wasm filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
||||
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
||||
4
.ipynb_checkpoints/chat_template-checkpoint.jinja
Normal file
4
.ipynb_checkpoints/chat_template-checkpoint.jinja
Normal file
@@ -0,0 +1,4 @@
|
||||
{% for message in messages %}{{'<|im_start|>' + message['role'] + '
|
||||
' + message['content'] + '<|im_end|>' + '
|
||||
'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant
|
||||
' }}{% endif %}
|
||||
14
.ipynb_checkpoints/config-checkpoint.json
Normal file
14
.ipynb_checkpoints/config-checkpoint.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"vocab_size": 49152,
|
||||
"d_model": 384,
|
||||
"n_heads": 6,
|
||||
"n_kv_heads": 2,
|
||||
"n_layers": 24,
|
||||
"d_ff": 1024,
|
||||
"head_dim": 64,
|
||||
"max_seq_len": 2048,
|
||||
"rope_theta": 10000.0,
|
||||
"rms_eps": 1e-05,
|
||||
"qkv_bias": true,
|
||||
"dropout": 0.0
|
||||
}
|
||||
244965
.ipynb_checkpoints/tokenizer-checkpoint.json
Normal file
244965
.ipynb_checkpoints/tokenizer-checkpoint.json
Normal file
File diff suppressed because it is too large
Load Diff
33
.ipynb_checkpoints/tokenizer_config-checkpoint.json
Normal file
33
.ipynb_checkpoints/tokenizer_config-checkpoint.json
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"add_prefix_space": false,
|
||||
"backend": "tokenizers",
|
||||
"bos_token": "<|endoftext|>",
|
||||
"clean_up_tokenization_spaces": false,
|
||||
"eos_token": "<|endoftext|>",
|
||||
"errors": "replace",
|
||||
"extra_special_tokens": [
|
||||
"<|endoftext|>",
|
||||
"<|im_start|>",
|
||||
"<|im_end|>",
|
||||
"<repo_name>",
|
||||
"<reponame>",
|
||||
"<file_sep>",
|
||||
"<filename>",
|
||||
"<gh_stars>",
|
||||
"<issue_start>",
|
||||
"<issue_comment>",
|
||||
"<issue_closed>",
|
||||
"<jupyter_start>",
|
||||
"<jupyter_text>",
|
||||
"<jupyter_code>",
|
||||
"<jupyter_output>",
|
||||
"<jupyter_script>",
|
||||
"<empty_output>"
|
||||
],
|
||||
"is_local": false,
|
||||
"model_max_length": 1000000000000000019884624838656,
|
||||
"pad_token": null,
|
||||
"tokenizer_class": "GPT2Tokenizer",
|
||||
"unk_token": "<|endoftext|>",
|
||||
"vocab_size": 49152
|
||||
}
|
||||
124
README.md
Normal file
124
README.md
Normal file
@@ -0,0 +1,124 @@
|
||||
---
|
||||
language:
|
||||
- en
|
||||
- code
|
||||
license: apache-2.0
|
||||
tags:
|
||||
- smol
|
||||
- pretraining
|
||||
- instruct
|
||||
- 50M
|
||||
- causal-lm
|
||||
- gqa
|
||||
- swiglu
|
||||
- rmsnorm
|
||||
datasets:
|
||||
- HuggingFaceTB/smollm-corpus
|
||||
metrics:
|
||||
- perplexity
|
||||
model-index:
|
||||
- name: Quark-50m-Instruct
|
||||
results: []
|
||||
pipeline_tag: text-generation
|
||||
---
|
||||
|
||||
# Quark-50m-Instruct
|
||||
|
||||
**Quark-50m-Instruct** is a small (≈56M parameters) decoder-only language model, fine-tuned for instruction following.
|
||||
It is built on the same architecture of “SmolLM” family and was fully pretrained on 5 billion tokens from
|
||||
[HuggingFaceTB/smollm‑corpus](https://huggingface.co/datasets/HuggingFaceTB/smollm-corpus).
|
||||
|
||||
- **Model type:** Causal Language Model (LLaMA‑style decoder)
|
||||
- **Architecture:** GQA · SwiGLU · RMSNorm · RoPE · Weight‑tying
|
||||
- **Pretraining tokens:** 5 B
|
||||
- **Fine‑tuning:** Instruction‑tuned (details below)
|
||||
- **Creators:** [OvercastLab](https://huggingface.co/OvercastLab) (research & development lab for ML/AI)
|
||||
- **Release date:** 22 April 2026
|
||||
|
||||
## Model Summary
|
||||
|
||||
Quark-50m-Instruct is designed to be an efficient assistant that can run on consumer GPUs (e.g., RTX 3070 with 8 GB VRAM)
|
||||
and even on CPU for light workloads. It is **not** competitive with large models on knowledge‑intensive tasks,
|
||||
but it excels at:
|
||||
|
||||
- Simple conversational tasks
|
||||
- Code generation and explanation (Python)
|
||||
- Short text rewriting and summarisation
|
||||
- On‑device / edge inference
|
||||
|
||||
The architecture closely follows the efficient‑small‑LM blueprint popularised by SmolLM:
|
||||
|
||||
| Component | Details |
|
||||
|-------------|-------------------------------|
|
||||
| Vocab size | 49,152 |
|
||||
| Hidden size | 384 |
|
||||
| Layers | 24 |
|
||||
| Attention | Grouped Query (6 Q heads, 2 KV heads) |
|
||||
| FFN | SwiGLU with 1,024 intermediate |
|
||||
| Position | RoPE (θ = 10,000) |
|
||||
| Normalisation | RMSNorm (pre‑block) |
|
||||
|
||||
Total trainable parameters: **≈48 M** (with weight tying).
|
||||
|
||||
### Benchmark Evaluation Metrics
|
||||
|
||||
| Category | Benchmark | Metric | Score / Value | Status |
|
||||
| :--- | :--- | :--- | :---: | :---: |
|
||||
| **Linguistics & Grammar** | BLiMP | Accuracy | 68.12% | Success |
|
||||
| **Commonsense & Reasoning** | PIQA | Normalized Accuracy | 57.83% | Success |
|
||||
| | COPA | Accuracy | 57.00% | Success |
|
||||
| | BoolQ | Accuracy | 52.17% | Success |
|
||||
| | WinoGrande | Accuracy | 47.36% | Success |
|
||||
| | HellaSwag | Normalized Accuracy | 28.49% | Success |
|
||||
| | RACE | Accuracy | 26.41% | Success |
|
||||
| | CommonsenseQA | Accuracy | 20.31% | Success |
|
||||
| **Academic & Knowledge** | SciQ | Normalized Accuracy | 49.00% | Success |
|
||||
| | ARC-Easy | Normalized Accuracy | 36.49% | Success |
|
||||
| | MMLU | Accuracy | 25.64% | Success |
|
||||
| | ARC-Challenge | Normalized Accuracy | 25.17% | Success |
|
||||
| | OpenBookQA | Normalized Accuracy | 25.40% | Success |
|
||||
| **Language Modeling** | LAMBADA | Accuracy | 15.87% | Success |
|
||||
| | WikiText-2 | Word Perplexity | 251.76 | Success |
|
||||
|
||||
*Note: The Arithmetic benchmark failed due to outdated script support (`arithmetic.py`), and SocialIQA failed due to a registration tag error (`siqa`). Total baseline execution completed successfully for all other 15 tasks.*
|
||||
|
||||
|
||||
## Uses
|
||||
|
||||
### Direct Use
|
||||
The model can be used via the 🤗 Transformers library for standard text generation.
|
||||
It expects chat‑formatted input (see example below).
|
||||
|
||||
### Downstream Use
|
||||
Because of the open Apache‑2.0 license, you may fine‑tune Quark-50m‑Instruct on your own data for
|
||||
domain‑specific tasks – for instance, a customer‑support bot, a code reviewer, or a story writer.
|
||||
|
||||
### Limitations
|
||||
- Limited world knowledge (stopped at mid‑2025 pretraining data).
|
||||
- Short context window (2,048 tokens).
|
||||
- Small size means it can make more factual mistakes than larger models.
|
||||
|
||||
## How to Get Started
|
||||
|
||||
```python
|
||||
from transformers import AutoTokenizer, AutoModelForCausalLM
|
||||
|
||||
model_name = "ThingAI/Quark-50m-Instruct"
|
||||
|
||||
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
||||
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto")
|
||||
|
||||
messages = [
|
||||
{"role": "system", "content": "You are Quark, a helpful assistant."},
|
||||
{"role": "user", "content": "Explain group query attention in one sentence."}
|
||||
]
|
||||
|
||||
inputs = tokenizer.apply_chat_template(
|
||||
messages,
|
||||
tokenize=True,
|
||||
add_generation_prompt=True,
|
||||
return_tensors="pt"
|
||||
).to(model.device)
|
||||
|
||||
outputs = model.generate(inputs, max_new_tokens=128)
|
||||
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
||||
4
chat_template.jinja
Normal file
4
chat_template.jinja
Normal file
@@ -0,0 +1,4 @@
|
||||
{% for message in messages %}{{'<|im_start|>' + message['role'] + '
|
||||
' + message['content'] + '<|im_end|>' + '
|
||||
'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant
|
||||
' }}{% endif %}
|
||||
34
config.json
Normal file
34
config.json
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"architectures": [
|
||||
"LlamaForCausalLM"
|
||||
],
|
||||
"attention_bias": true,
|
||||
"attention_dropout": 0.0,
|
||||
"bos_token_id": 0,
|
||||
"dtype": "bfloat16",
|
||||
"eos_token_id": 0,
|
||||
"head_dim": 64,
|
||||
"hidden_act": "silu",
|
||||
"hidden_size": 384,
|
||||
"initializer_range": 0.02,
|
||||
"intermediate_size": 1024,
|
||||
"is_llama_config": true,
|
||||
"max_position_embeddings": 2048,
|
||||
"mlp_bias": false,
|
||||
"model_type": "llama",
|
||||
"num_attention_heads": 6,
|
||||
"num_hidden_layers": 24,
|
||||
"num_key_value_heads": 2,
|
||||
"pad_token_id": 0,
|
||||
"pretraining_tp": 1,
|
||||
"rms_norm_eps": 1e-05,
|
||||
"rope_interleaved": false,
|
||||
"rope_parameters": {
|
||||
"rope_theta": 10000.0,
|
||||
"rope_type": "default"
|
||||
},
|
||||
"tie_word_embeddings": true,
|
||||
"transformers_version": "5.6.2",
|
||||
"use_cache": false,
|
||||
"vocab_size": 49152
|
||||
}
|
||||
11
generation_config.json
Normal file
11
generation_config.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"_from_model_config": true,
|
||||
"bos_token_id": 0,
|
||||
"eos_token_id": [
|
||||
0,
|
||||
2
|
||||
],
|
||||
"pad_token_id": 0,
|
||||
"transformers_version": "5.6.2",
|
||||
"use_cache": true
|
||||
}
|
||||
3
model.safetensors
Normal file
3
model.safetensors
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:ae5952eb75980cb4d0a309de77867170af85f62c992c16db60c244ad71798cd6
|
||||
size 113367352
|
||||
3
pytorch_model.bin
Normal file
3
pytorch_model.bin
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f123e7c62d0615acb63f6e02c1fef39ad165fedd47a48f734bbc58eb23860c8e
|
||||
size 226733547
|
||||
244965
tokenizer.json
Normal file
244965
tokenizer.json
Normal file
File diff suppressed because it is too large
Load Diff
34
tokenizer_config.json
Normal file
34
tokenizer_config.json
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"add_prefix_space": false,
|
||||
"backend": "tokenizers",
|
||||
"bos_token": "<|endoftext|>",
|
||||
"clean_up_tokenization_spaces": false,
|
||||
"eos_token": "<|endoftext|>",
|
||||
"errors": "replace",
|
||||
"extra_special_tokens": [
|
||||
"<|endoftext|>",
|
||||
"<|im_start|>",
|
||||
"<|im_end|>",
|
||||
"<repo_name>",
|
||||
"<reponame>",
|
||||
"<file_sep>",
|
||||
"<filename>",
|
||||
"<gh_stars>",
|
||||
"<issue_start>",
|
||||
"<issue_comment>",
|
||||
"<issue_closed>",
|
||||
"<jupyter_start>",
|
||||
"<jupyter_text>",
|
||||
"<jupyter_code>",
|
||||
"<jupyter_output>",
|
||||
"<jupyter_script>",
|
||||
"<empty_output>"
|
||||
],
|
||||
"is_local": true,
|
||||
"local_files_only": false,
|
||||
"model_max_length": 1000000000000000019884624838656,
|
||||
"pad_token": "<|endoftext|>",
|
||||
"tokenizer_class": "GPT2Tokenizer",
|
||||
"unk_token": "<|endoftext|>",
|
||||
"vocab_size": 49152
|
||||
}
|
||||
3
training_args.bin
Normal file
3
training_args.bin
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:82a7ba29d21c786c5562de6a6c7a3aa158352399f3651c4038d36d59bf4bd17e
|
||||
size 5304
|
||||
Reference in New Issue
Block a user