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, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("InterstellarCG/HRM-Text-1B-Code-FT") model = AutoModelForCausalLM.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
| license: mit | |
| language: | |
| - en | |
| library_name: transformers | |
| tags: | |
| - code | |
| - text-generation | |
| - hrm-text | |
| - fine-tuned | |
| base_model: sapientai/hrm-text-1b | |
| # HRM-Text-1B Code Fine-tuned | |
| Fine-tuned from HRM-Text-1B on combined code dataset (192M tokens). | |
| ## Training Details | |
| - **Base**: HRM-Text-1B (stacked from HTML/CSS 100k checkpoint) | |
| - **Dataset**: Combined code (Python, JavaScript, TypeScript, SQL, HTML/CSS) | |
| - **Tokens**: 192M | |
| - **Epochs**: 3 | |
| - **Learning rate**: 1e-5 | |
| ## Capabilities | |
| - Python code generation | |
| - JavaScript functions | |
| - SQL queries | |
| - General QA (improved over base) | |
| ## Limitations | |
| - Weak at React/TSX syntax | |
| - HTML/CSS output can be malformed | |
| - TypeScript interfaces not well-formed | |
| ## Usage | |
| ```python | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| model = AutoModelForCausalLM.from_pretrained("InterstellarCG/HRM-Text-1B-Code-FT") | |
| tokenizer = AutoTokenizer.from_pretrained("InterstellarCG/HRM-Text-1B-Code-FT") | |
| ``` | |
| ## Evaluation | |
| | Task | Base | Fine-tuned | | |
| |------|------|------------| | |
| | Python (is_prime) | Garbage | Correct | | |
| | JS (reverse array) | Garbage | Correct | | |
| | SQL (join query) | Garbage | Correct | | |
| | QA (Paris capital) | Garbage | Correct | | |