Instructions to use LL-Square/CodeForge-TinyLlama1.1B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use LL-Square/CodeForge-TinyLlama1.1B-Instruct with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("TinyLlama/TinyLlama-1.1B-Chat-v1.0") model = PeftModel.from_pretrained(base_model, "LL-Square/CodeForge-TinyLlama1.1B-Instruct") - Transformers
How to use LL-Square/CodeForge-TinyLlama1.1B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LL-Square/CodeForge-TinyLlama1.1B-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("LL-Square/CodeForge-TinyLlama1.1B-Instruct", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use LL-Square/CodeForge-TinyLlama1.1B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LL-Square/CodeForge-TinyLlama1.1B-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LL-Square/CodeForge-TinyLlama1.1B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/LL-Square/CodeForge-TinyLlama1.1B-Instruct
- SGLang
How to use LL-Square/CodeForge-TinyLlama1.1B-Instruct 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 "LL-Square/CodeForge-TinyLlama1.1B-Instruct" \ --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": "LL-Square/CodeForge-TinyLlama1.1B-Instruct", "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 "LL-Square/CodeForge-TinyLlama1.1B-Instruct" \ --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": "LL-Square/CodeForge-TinyLlama1.1B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use LL-Square/CodeForge-TinyLlama1.1B-Instruct with Docker Model Runner:
docker model run hf.co/LL-Square/CodeForge-TinyLlama1.1B-Instruct
lazarusrolando commited on
Update README.md
Browse files
README.md
CHANGED
|
@@ -19,30 +19,6 @@ Lightweight repository for preparing, training, and uploading small instruct-sty
|
|
| 19 |
|
| 20 |
This project contains simple scripts to train a model (`train.py`), run inference (`main.py`), configure logging (`logging_setup.py`), and upload artifacts (`upload.py`). A small sample dataset is included as `sample.jsonl`.
|
| 21 |
|
| 22 |
-
## Quick overview
|
| 23 |
-
|
| 24 |
-
- **Files:**
|
| 25 |
-
- `logging_setup.py` — central logging configuration used by scripts.
|
| 26 |
-
- `train.py` — training / fine-tuning entrypoint.
|
| 27 |
-
- `main.py` — minimal inference/demo runner.
|
| 28 |
-
- `upload.py` — helper to upload model artifacts to a hub or storage.
|
| 29 |
-
- `sample.jsonl` — small example dataset (one JSON object per line).
|
| 30 |
-
- `CodeForge-Instruct/` — supporting code and assets.
|
| 31 |
-
|
| 32 |
-
## Requirements
|
| 33 |
-
|
| 34 |
-
- Python 3.10+
|
| 35 |
-
- Typical ML dependencies: `torch`, `transformers`, `peft`, `datasets`, `accelerate`, `tqdm`, `safetensors` (if used). Install example:
|
| 36 |
-
|
| 37 |
-
```bash
|
| 38 |
-
python -m venv .venv
|
| 39 |
-
source .venv/Scripts/activate # Windows: .venv\Scripts\activate
|
| 40 |
-
pip install --upgrade pip
|
| 41 |
-
pip install torch transformers peft datasets accelerate tqdm safetensors
|
| 42 |
-
```
|
| 43 |
-
|
| 44 |
-
If you prefer pinned dependencies, create `requirements.txt` and install via `pip install -r requirements.txt`.
|
| 45 |
-
|
| 46 |
## Data format
|
| 47 |
|
| 48 |
The dataset expects newline-delimited JSON (`.jsonl`) where each line is an object with at least `prompt` and `response` (or `instruction`/`output`) fields. Example (`sample.jsonl`):
|
|
|
|
| 19 |
|
| 20 |
This project contains simple scripts to train a model (`train.py`), run inference (`main.py`), configure logging (`logging_setup.py`), and upload artifacts (`upload.py`). A small sample dataset is included as `sample.jsonl`.
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
## Data format
|
| 23 |
|
| 24 |
The dataset expects newline-delimited JSON (`.jsonl`) where each line is an object with at least `prompt` and `response` (or `instruction`/`output`) fields. Example (`sample.jsonl`):
|