Text Generation
Transformers
Safetensors
Italian
English
quark
causal-lm
bilingual
italian
english
small-language-model
trained-from-scratch
conversational
custom_code
Instructions to use ThingAI/ARK-135M-Bilingual with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ThingAI/ARK-135M-Bilingual with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ThingAI/ARK-135M-Bilingual", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("ThingAI/ARK-135M-Bilingual", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ThingAI/ARK-135M-Bilingual with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ThingAI/ARK-135M-Bilingual" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ThingAI/ARK-135M-Bilingual", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ThingAI/ARK-135M-Bilingual
- SGLang
How to use ThingAI/ARK-135M-Bilingual with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "ThingAI/ARK-135M-Bilingual" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ThingAI/ARK-135M-Bilingual", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "ThingAI/ARK-135M-Bilingual" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ThingAI/ARK-135M-Bilingual", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ThingAI/ARK-135M-Bilingual with Docker Model Runner:
docker model run hf.co/ThingAI/ARK-135M-Bilingual
Fix RoPE inv_freq per ogni layer
Browse filesfix: recompute RoPE inv_freq buffers (were saved as NaN, causing inference failure)
- config.json +26 -16
- generation_config.json +4 -0
- model.safetensors +2 -2
- tokenizer_config.json +1 -1
config.json
CHANGED
|
@@ -1,29 +1,39 @@
|
|
| 1 |
{
|
| 2 |
-
"
|
| 3 |
-
|
|
|
|
| 4 |
"auto_map": {
|
| 5 |
"AutoConfig": "configuration_quark.QuarkConfig",
|
| 6 |
"AutoModelForCausalLM": "modeling_quark.QuarkForCausalLM"
|
| 7 |
},
|
| 8 |
-
"
|
|
|
|
| 9 |
"d_model": 576,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
"n_heads": 9,
|
| 11 |
"n_kv_heads": 3,
|
| 12 |
"n_layers": 30,
|
| 13 |
-
"d_ff": 1536,
|
| 14 |
-
"head_dim": 64,
|
| 15 |
-
"max_seq_len": 2048,
|
| 16 |
-
"rope_theta": 10000.0,
|
| 17 |
-
"rms_eps": 1e-5,
|
| 18 |
"qkv_bias": true,
|
| 19 |
-
"
|
| 20 |
-
"
|
| 21 |
-
"tie_word_embeddings": true,
|
| 22 |
"sft_dataset": "MBZUAI/Bactrian-X (it+en)",
|
| 23 |
-
"sft_steps": 4000,
|
| 24 |
"sft_loss": 1.9,
|
| 25 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
"tokenizer": "ThingAI/QuarkTokenizer",
|
| 27 |
-
"
|
| 28 |
-
"
|
| 29 |
-
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"QuarkForCausalLM"
|
| 4 |
+
],
|
| 5 |
"auto_map": {
|
| 6 |
"AutoConfig": "configuration_quark.QuarkConfig",
|
| 7 |
"AutoModelForCausalLM": "modeling_quark.QuarkForCausalLM"
|
| 8 |
},
|
| 9 |
+
"base_pretrain": "15.7B tokens bilingual IT+EN",
|
| 10 |
+
"d_ff": 1536,
|
| 11 |
"d_model": 576,
|
| 12 |
+
"dropout": 0.0,
|
| 13 |
+
"dtype": "float32",
|
| 14 |
+
"head_dim": 64,
|
| 15 |
+
"languages": [
|
| 16 |
+
"it",
|
| 17 |
+
"en"
|
| 18 |
+
],
|
| 19 |
+
"max_seq_len": 2048,
|
| 20 |
+
"model_type": "quark",
|
| 21 |
"n_heads": 9,
|
| 22 |
"n_kv_heads": 3,
|
| 23 |
"n_layers": 30,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
"qkv_bias": true,
|
| 25 |
+
"rms_eps": 1e-05,
|
| 26 |
+
"rope_theta": 10000.0,
|
|
|
|
| 27 |
"sft_dataset": "MBZUAI/Bactrian-X (it+en)",
|
|
|
|
| 28 |
"sft_loss": 1.9,
|
| 29 |
+
"sft_steps": 4000,
|
| 30 |
+
"special_tokens": [
|
| 31 |
+
"<|user|>",
|
| 32 |
+
"<|assistant|>",
|
| 33 |
+
"<|end|>"
|
| 34 |
+
],
|
| 35 |
+
"tie_word_embeddings": true,
|
| 36 |
"tokenizer": "ThingAI/QuarkTokenizer",
|
| 37 |
+
"transformers_version": "5.6.0",
|
| 38 |
+
"vocab_size": 65537
|
| 39 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"transformers_version": "5.6.0"
|
| 4 |
+
}
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8b302a44dc75e61012961669ad6b11e4b4885ee57c9e89ca3debc0ce89e8dced
|
| 3 |
+
size 726959640
|
tokenizer_config.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
| 10 |
"<|assistant|>",
|
| 11 |
"<|end|>"
|
| 12 |
],
|
| 13 |
-
"is_local":
|
| 14 |
"languages": [
|
| 15 |
"en",
|
| 16 |
"it"
|
|
|
|
| 10 |
"<|assistant|>",
|
| 11 |
"<|end|>"
|
| 12 |
],
|
| 13 |
+
"is_local": false,
|
| 14 |
"languages": [
|
| 15 |
"en",
|
| 16 |
"it"
|