Instructions to use InterstellarCG/HRM-Text-1B-Code-FT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use InterstellarCG/HRM-Text-1B-Code-FT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="InterstellarCG/HRM-Text-1B-Code-FT")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("InterstellarCG/HRM-Text-1B-Code-FT") model = AutoModelForMultimodalLM.from_pretrained("InterstellarCG/HRM-Text-1B-Code-FT") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use InterstellarCG/HRM-Text-1B-Code-FT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "InterstellarCG/HRM-Text-1B-Code-FT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "InterstellarCG/HRM-Text-1B-Code-FT", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/InterstellarCG/HRM-Text-1B-Code-FT
- SGLang
How to use InterstellarCG/HRM-Text-1B-Code-FT 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 "InterstellarCG/HRM-Text-1B-Code-FT" \ --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": "InterstellarCG/HRM-Text-1B-Code-FT", "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 "InterstellarCG/HRM-Text-1B-Code-FT" \ --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": "InterstellarCG/HRM-Text-1B-Code-FT", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use InterstellarCG/HRM-Text-1B-Code-FT with Docker Model Runner:
docker model run hf.co/InterstellarCG/HRM-Text-1B-Code-FT
Upload HRM-Text-1B Code Fine-tuned epoch 3
Browse files- README.md +52 -0
- config.json +26 -0
- model.safetensors +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +12 -0
README.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
library_name: transformers
|
| 6 |
+
tags:
|
| 7 |
+
- code
|
| 8 |
+
- text-generation
|
| 9 |
+
- hrm-text
|
| 10 |
+
- fine-tuned
|
| 11 |
+
base_model: sapientai/hrm-text-1b
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
# HRM-Text-1B Code Fine-tuned
|
| 15 |
+
|
| 16 |
+
Fine-tuned from HRM-Text-1B on combined code dataset (192M tokens).
|
| 17 |
+
|
| 18 |
+
## Training Details
|
| 19 |
+
- **Base**: HRM-Text-1B (stacked from HTML/CSS 100k checkpoint)
|
| 20 |
+
- **Dataset**: Combined code (Python, JavaScript, TypeScript, SQL, HTML/CSS)
|
| 21 |
+
- **Tokens**: 192M
|
| 22 |
+
- **Epochs**: 3
|
| 23 |
+
- **Learning rate**: 1e-5
|
| 24 |
+
|
| 25 |
+
## Capabilities
|
| 26 |
+
- Python code generation
|
| 27 |
+
- JavaScript functions
|
| 28 |
+
- SQL queries
|
| 29 |
+
- General QA (improved over base)
|
| 30 |
+
|
| 31 |
+
## Limitations
|
| 32 |
+
- Weak at React/TSX syntax
|
| 33 |
+
- HTML/CSS output can be malformed
|
| 34 |
+
- TypeScript interfaces not well-formed
|
| 35 |
+
|
| 36 |
+
## Usage
|
| 37 |
+
|
| 38 |
+
```python
|
| 39 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 40 |
+
|
| 41 |
+
model = AutoModelForCausalLM.from_pretrained("InterstellarCG/HRM-Text-1B-Code-FT")
|
| 42 |
+
tokenizer = AutoTokenizer.from_pretrained("InterstellarCG/HRM-Text-1B-Code-FT")
|
| 43 |
+
```
|
| 44 |
+
|
| 45 |
+
## Evaluation
|
| 46 |
+
|
| 47 |
+
| Task | Base | Fine-tuned |
|
| 48 |
+
|------|------|------------|
|
| 49 |
+
| Python (is_prime) | Garbage | Correct |
|
| 50 |
+
| JS (reverse array) | Garbage | Correct |
|
| 51 |
+
| SQL (join query) | Garbage | Correct |
|
| 52 |
+
| QA (Paris capital) | Garbage | Correct |
|
config.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model_type": "hrm_text",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"HrmTextForCausalLM"
|
| 5 |
+
],
|
| 6 |
+
"vocab_size": 65536,
|
| 7 |
+
"hidden_size": 1536,
|
| 8 |
+
"intermediate_size": 4096,
|
| 9 |
+
"num_hidden_layers": 32,
|
| 10 |
+
"num_attention_heads": 12,
|
| 11 |
+
"num_key_value_heads": 12,
|
| 12 |
+
"head_dim": 128,
|
| 13 |
+
"H_cycles": 2,
|
| 14 |
+
"L_cycles": 3,
|
| 15 |
+
"L_bp_steps": [
|
| 16 |
+
0,
|
| 17 |
+
3
|
| 18 |
+
],
|
| 19 |
+
"max_position_embeddings": 4096,
|
| 20 |
+
"rms_norm_eps": 1e-06,
|
| 21 |
+
"rope_theta": 10000.0,
|
| 22 |
+
"tie_word_embeddings": false,
|
| 23 |
+
"initializer_range": 0.025515518153991442,
|
| 24 |
+
"embedding_scale": 39.191835884530846,
|
| 25 |
+
"prefix_lm": true
|
| 26 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1da7577c9f7c9e88c136d7529eae5c3e638dde9874c1793725f7a2c2600eb1bb
|
| 3 |
+
size 2365606568
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": null,
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"bos_token": "<|im_start|>",
|
| 5 |
+
"eos_token": "<|box_end|>",
|
| 6 |
+
"is_local": true,
|
| 7 |
+
"local_files_only": false,
|
| 8 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 9 |
+
"pad_token": "<|endoftext|>",
|
| 10 |
+
"tokenizer_class": "Qwen2Tokenizer",
|
| 11 |
+
"unk_token": "<|endoftext|>"
|
| 12 |
+
}
|