Text Generation
Transformers
English
qwen2
code-generation
python
fine-tuning
Qwen
tools
agent-framework
multi-agent
conversational
Eval Results (legacy)
Instructions to use my-ai-stack/Stack-2-9-finetuned with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use my-ai-stack/Stack-2-9-finetuned with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="my-ai-stack/Stack-2-9-finetuned") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("my-ai-stack/Stack-2-9-finetuned") model = AutoModelForCausalLM.from_pretrained("my-ai-stack/Stack-2-9-finetuned") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use my-ai-stack/Stack-2-9-finetuned with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "my-ai-stack/Stack-2-9-finetuned" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "my-ai-stack/Stack-2-9-finetuned", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/my-ai-stack/Stack-2-9-finetuned
- SGLang
How to use my-ai-stack/Stack-2-9-finetuned 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 "my-ai-stack/Stack-2-9-finetuned" \ --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": "my-ai-stack/Stack-2-9-finetuned", "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 "my-ai-stack/Stack-2-9-finetuned" \ --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": "my-ai-stack/Stack-2-9-finetuned", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use my-ai-stack/Stack-2-9-finetuned with Docker Model Runner:
docker model run hf.co/my-ai-stack/Stack-2-9-finetuned
walidsobhie-code Claude Opus 4.6 commited on
Commit ·
f268fb6
1
Parent(s): 1c64613
docs: update README with training options and RTMP extraction
Browse files- Add training options table (Colab, Kaggle, Local Mac, Cloud)
- Add RTMP tool extraction instructions
- Add Kaggle notebook reference
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
README.md
CHANGED
|
@@ -245,6 +245,15 @@ python scripts/merge_lora_adapters.py \
|
|
| 245 |
|
| 246 |
## 🛠️ Training & Fine-Tuning
|
| 247 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 248 |
### Quick Training (Colab)
|
| 249 |
|
| 250 |
Use the provided notebook for quick prototyping:
|
|
@@ -281,6 +290,54 @@ For production training on GPUs:
|
|
| 281 |
|
| 282 |
See each script for usage instructions.
|
| 283 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 284 |
---
|
| 285 |
|
| 286 |
## 🐳 Deployment
|
|
|
|
| 245 |
|
| 246 |
## 🛠️ Training & Fine-Tuning
|
| 247 |
|
| 248 |
+
### Training Options
|
| 249 |
+
|
| 250 |
+
| Platform | Notebook | Description |
|
| 251 |
+
|----------|----------|-------------|
|
| 252 |
+
| **Google Colab** | `colab_train_stack29.ipynb` | Free T4 GPU, 3-5 hours |
|
| 253 |
+
| **Kaggle** | `kaggle_train_stack29.ipynb` | Free P100 GPU, 2-4 hours |
|
| 254 |
+
| **Local Mac** | `train_local.py` | MPS/Apple Silicon |
|
| 255 |
+
| **Cloud GPUs** | See below | RunPod, Vast.ai, etc |
|
| 256 |
+
|
| 257 |
### Quick Training (Colab)
|
| 258 |
|
| 259 |
Use the provided notebook for quick prototyping:
|
|
|
|
| 290 |
|
| 291 |
See each script for usage instructions.
|
| 292 |
|
| 293 |
+
### Extracting Training Data from Your Codebase
|
| 294 |
+
|
| 295 |
+
Extract tool patterns from your codebase to train the model:
|
| 296 |
+
|
| 297 |
+
```bash
|
| 298 |
+
# Extract tool patterns
|
| 299 |
+
python scripts/extract_rtmp_tools.py
|
| 300 |
+
|
| 301 |
+
# Create advanced examples
|
| 302 |
+
python scripts/extract_rtmp_tools_advanced.py
|
| 303 |
+
```
|
| 304 |
+
|
| 305 |
+
This creates `data/rtmp-tools/` with tool usage patterns that can be combined with the main training data.
|
| 306 |
+
|
| 307 |
+
### Kaggle Training
|
| 308 |
+
|
| 309 |
+
Free GPU training on Kaggle (P100 16GB VRAM):
|
| 310 |
+
|
| 311 |
+
```bash
|
| 312 |
+
# Open in Kaggle
|
| 313 |
+
kaggle_train_stack29.ipynb
|
| 314 |
+
```
|
| 315 |
+
|
| 316 |
+
### Local Mac Training (MPS)
|
| 317 |
+
|
| 318 |
+
For Apple Silicon Macs without GPU cloud access:
|
| 319 |
+
|
| 320 |
+
```bash
|
| 321 |
+
python train_local.py
|
| 322 |
+
```
|
| 323 |
+
|
| 324 |
+
### Extracting Tool Patterns from RTMP
|
| 325 |
+
|
| 326 |
+
Extract training data from your RTMP codebase to teach the model your custom tools:
|
| 327 |
+
|
| 328 |
+
```bash
|
| 329 |
+
# Extract tool patterns
|
| 330 |
+
python scripts/extract_rtmp_tools.py
|
| 331 |
+
python scripts/extract_rtmp_tools_advanced.py
|
| 332 |
+
|
| 333 |
+
# Combined data includes 46+ tool patterns
|
| 334 |
+
data/rtmp-tools/combined_tools.jsonl
|
| 335 |
+
```
|
| 336 |
+
|
| 337 |
+
The combined training data includes:
|
| 338 |
+
- 41,807 code completion examples
|
| 339 |
+
- 59 RTMP tool usage patterns (BashTool, FileReadTool, Task tools, etc.)
|
| 340 |
+
|
| 341 |
---
|
| 342 |
|
| 343 |
## 🐳 Deployment
|