Instructions to use edamamex/qwen-ctfer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use edamamex/qwen-ctfer with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-Coder-7B-Instruct") model = PeftModel.from_pretrained(base_model, "edamamex/qwen-ctfer") - Transformers
How to use edamamex/qwen-ctfer with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="edamamex/qwen-ctfer") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("edamamex/qwen-ctfer", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use edamamex/qwen-ctfer with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "edamamex/qwen-ctfer" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "edamamex/qwen-ctfer", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/edamamex/qwen-ctfer
- SGLang
How to use edamamex/qwen-ctfer 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 "edamamex/qwen-ctfer" \ --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": "edamamex/qwen-ctfer", "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 "edamamex/qwen-ctfer" \ --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": "edamamex/qwen-ctfer", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use edamamex/qwen-ctfer with Docker Model Runner:
docker model run hf.co/edamamex/qwen-ctfer
| { | |
| "run_name": "qwen-ctfer", | |
| "seed": 42, | |
| "model": { | |
| "name_or_path": "Qwen/Qwen2.5-Coder-7B-Instruct", | |
| "torch_dtype": "bfloat16", | |
| "trust_remote_code": false, | |
| "use_fast_tokenizer": true, | |
| "padding_side": "right", | |
| "attn_implementation": "sdpa", | |
| "device_map": "auto", | |
| "load_in_4bit": true, | |
| "bnb_4bit_quant_type": "nf4", | |
| "bnb_4bit_use_double_quant": true, | |
| "bnb_4bit_compute_dtype": "bfloat16" | |
| }, | |
| "data": { | |
| "train_file": "data/processed/train.jsonl", | |
| "eval_file": "data/processed/eval.jsonl" | |
| }, | |
| "formatting": { | |
| "assistant_only_loss": true | |
| }, | |
| "lora": { | |
| "r": 16, | |
| "alpha": 32, | |
| "dropout": 0.05, | |
| "bias": "none", | |
| "target_modules": "all-linear", | |
| "task_type": "CAUSAL_LM" | |
| }, | |
| "training": { | |
| "output_dir": "outputs/checkpoints/qwen-ctfer", | |
| "num_train_epochs": 2, | |
| "per_device_train_batch_size": 1, | |
| "per_device_eval_batch_size": 1, | |
| "gradient_accumulation_steps": 8, | |
| "learning_rate": 0.0002, | |
| "lr_scheduler_type": "cosine", | |
| "warmup_ratio": 0.03, | |
| "weight_decay": 0.0, | |
| "max_grad_norm": 1.0, | |
| "logging_steps": 5, | |
| "save_strategy": "steps", | |
| "save_steps": 25, | |
| "save_total_limit": 2, | |
| "evaluation_strategy": "steps", | |
| "eval_steps": 25, | |
| "gradient_checkpointing": true, | |
| "bf16": true, | |
| "fp16": false, | |
| "packing": false, | |
| "max_seq_length": 2048, | |
| "report_to": [ | |
| "none" | |
| ] | |
| } | |
| } | |