Instructions to use Nano2527/Bank1M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Nano2527/Bank1M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Nano2527/Bank1M")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Nano2527/Bank1M") model = AutoModelForCausalLM.from_pretrained("Nano2527/Bank1M", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Nano2527/Bank1M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Nano2527/Bank1M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Nano2527/Bank1M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Nano2527/Bank1M
- SGLang
How to use Nano2527/Bank1M 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 "Nano2527/Bank1M" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Nano2527/Bank1M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "Nano2527/Bank1M" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Nano2527/Bank1M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Nano2527/Bank1M with Docker Model Runner:
docker model run hf.co/Nano2527/Bank1M
Upload 8 files
Browse files- README.md +22 -1
- artifact_summary.json +15 -0
- config.json +35 -0
- generation_config.json +10 -0
- model.safetensors +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +20 -0
- tokenizer_seed_corpus.txt +5 -0
README.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
| 1 |
---
|
| 2 |
-
license:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
library_name: transformers
|
| 4 |
+
pipeline_tag: text-generation
|
| 5 |
+
tags:
|
| 6 |
+
- datathai
|
| 7 |
+
- thai
|
| 8 |
+
- toy-model
|
| 9 |
+
- safetensors
|
| 10 |
---
|
| 11 |
+
|
| 12 |
+
# DataThai-1M-playground-improved
|
| 13 |
+
|
| 14 |
+
Playable tiny Thai-English toy model for pipeline testing.
|
| 15 |
+
|
| 16 |
+
This is **not** DataThai-1B. It is a ~1M parameter smoke/playground model trained on a tiny QA-style demo corpus.
|
| 17 |
+
|
| 18 |
+
Use it for:
|
| 19 |
+
- loading test
|
| 20 |
+
- generation test
|
| 21 |
+
- Hugging Face deploy test
|
| 22 |
+
- sharing a small runnable model artifact
|
| 23 |
+
|
| 24 |
+
Do not use it as a real language model benchmark.
|
artifact_summary.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"artifact_dir": "/content/datathai-deploy/DataThai-QwenStyle-smoke-qwen2",
|
| 3 |
+
"repo_id": "SPAISS6F1/DataThai-QwenStyle-smoke",
|
| 4 |
+
"size": "smoke",
|
| 5 |
+
"arch": "qwen2",
|
| 6 |
+
"parameters": 902144,
|
| 7 |
+
"status": "tiny smoke-trained",
|
| 8 |
+
"safetensors": [
|
| 9 |
+
"model.safetensors"
|
| 10 |
+
],
|
| 11 |
+
"index_files": [],
|
| 12 |
+
"name": "DataThai-1M-playground-improved",
|
| 13 |
+
"note": "Improved tiny playable smoke model, not a real 1B LLM.",
|
| 14 |
+
"recommended_repo_name": "DataThai-1M-playground-improved"
|
| 15 |
+
}
|
config.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Qwen2ForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_dropout": 0.0,
|
| 6 |
+
"bos_token_id": 0,
|
| 7 |
+
"dtype": "float32",
|
| 8 |
+
"eos_token_id": 0,
|
| 9 |
+
"hidden_act": "silu",
|
| 10 |
+
"hidden_size": 128,
|
| 11 |
+
"initializer_range": 0.02,
|
| 12 |
+
"intermediate_size": 384,
|
| 13 |
+
"layer_types": [
|
| 14 |
+
"full_attention",
|
| 15 |
+
"full_attention"
|
| 16 |
+
],
|
| 17 |
+
"max_position_embeddings": 512,
|
| 18 |
+
"max_window_layers": 28,
|
| 19 |
+
"model_type": "qwen2",
|
| 20 |
+
"num_attention_heads": 4,
|
| 21 |
+
"num_hidden_layers": 2,
|
| 22 |
+
"num_key_value_heads": 1,
|
| 23 |
+
"pad_token_id": 6,
|
| 24 |
+
"rms_norm_eps": 1e-06,
|
| 25 |
+
"rope_parameters": {
|
| 26 |
+
"rope_theta": 1000000.0,
|
| 27 |
+
"rope_type": "default"
|
| 28 |
+
},
|
| 29 |
+
"sliding_window": null,
|
| 30 |
+
"tie_word_embeddings": true,
|
| 31 |
+
"transformers_version": "5.10.2",
|
| 32 |
+
"use_cache": true,
|
| 33 |
+
"use_sliding_window": false,
|
| 34 |
+
"vocab_size": 4096
|
| 35 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 0,
|
| 4 |
+
"eos_token_id": 0,
|
| 5 |
+
"output_attentions": false,
|
| 6 |
+
"output_hidden_states": false,
|
| 7 |
+
"pad_token_id": 6,
|
| 8 |
+
"transformers_version": "5.10.2",
|
| 9 |
+
"use_cache": true
|
| 10 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4514ff9e19fa0891f0a7b76f23daae2ba3ba7a2e7b1c9d235a1fdd9b3ba82aeb
|
| 3 |
+
size 3611320
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": null,
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"bos_token": "<|endoftext|>",
|
| 5 |
+
"clean_up_tokenization_spaces": false,
|
| 6 |
+
"eos_token": "<|endoftext|>",
|
| 7 |
+
"extra_special_tokens": [
|
| 8 |
+
"<|im_start|>",
|
| 9 |
+
"<|im_end|>",
|
| 10 |
+
"<|system|>",
|
| 11 |
+
"<|user|>",
|
| 12 |
+
"<|assistant|>"
|
| 13 |
+
],
|
| 14 |
+
"is_local": true,
|
| 15 |
+
"local_files_only": false,
|
| 16 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 17 |
+
"pad_token": "<|pad|>",
|
| 18 |
+
"tokenizer_class": "Qwen2Tokenizer",
|
| 19 |
+
"unk_token": "<|endoftext|>"
|
| 20 |
+
}
|
tokenizer_seed_corpus.txt
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
ภาษาไทยเป็นภาษาที่สวยงามและมีเอกลักษณ์ DataThai-1B is a Thai-first English-capable LLM.
|
| 2 |
+
การสร้างโมเดลภาษา from scratch ต้องมี tokenizer, data cleaning, pretraining, evaluation, and safety tuning.
|
| 3 |
+
Transformers use attention, RoPE, RMSNorm, and SwiGLU to model long-range dependencies.
|
| 4 |
+
ตัวอย่างโจทย์: ถ้า x = 3 และ y = 5 แล้ว x*y + 2 เท่ากับ 17
|
| 5 |
+
def add(a, b): return a + b # ฟังก์ชันบวกเลขสองจำนวน
|