Instructions to use lsteno/qwen2-7b-lora-opencodeinstruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use lsteno/qwen2-7b-lora-opencodeinstruct with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2-7B") model = PeftModel.from_pretrained(base_model, "lsteno/qwen2-7b-lora-opencodeinstruct") - Transformers
How to use lsteno/qwen2-7b-lora-opencodeinstruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="lsteno/qwen2-7b-lora-opencodeinstruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("lsteno/qwen2-7b-lora-opencodeinstruct", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use lsteno/qwen2-7b-lora-opencodeinstruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "lsteno/qwen2-7b-lora-opencodeinstruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lsteno/qwen2-7b-lora-opencodeinstruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/lsteno/qwen2-7b-lora-opencodeinstruct
- SGLang
How to use lsteno/qwen2-7b-lora-opencodeinstruct 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 "lsteno/qwen2-7b-lora-opencodeinstruct" \ --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": "lsteno/qwen2-7b-lora-opencodeinstruct", "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 "lsteno/qwen2-7b-lora-opencodeinstruct" \ --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": "lsteno/qwen2-7b-lora-opencodeinstruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use lsteno/qwen2-7b-lora-opencodeinstruct with Docker Model Runner:
docker model run hf.co/lsteno/qwen2-7b-lora-opencodeinstruct
| { | |
| "best_global_step": null, | |
| "best_metric": null, | |
| "best_model_checkpoint": null, | |
| "epoch": 2.64, | |
| "eval_steps": 500, | |
| "global_step": 50, | |
| "is_hyper_param_search": false, | |
| "is_local_process_zero": true, | |
| "is_world_process_zero": true, | |
| "log_history": [ | |
| { | |
| "epoch": 0.5333333333333333, | |
| "grad_norm": 0.24305464327335358, | |
| "learning_rate": 0.00018, | |
| "loss": 0.4307, | |
| "step": 10 | |
| }, | |
| { | |
| "epoch": 1.0533333333333332, | |
| "grad_norm": 0.12696263194084167, | |
| "learning_rate": 0.00016170212765957446, | |
| "loss": 0.2921, | |
| "step": 20 | |
| }, | |
| { | |
| "epoch": 1.5866666666666667, | |
| "grad_norm": 0.18280404806137085, | |
| "learning_rate": 0.00011914893617021277, | |
| "loss": 0.2568, | |
| "step": 30 | |
| }, | |
| { | |
| "epoch": 2.1066666666666665, | |
| "grad_norm": 0.17879144847393036, | |
| "learning_rate": 7.659574468085106e-05, | |
| "loss": 0.2264, | |
| "step": 40 | |
| }, | |
| { | |
| "epoch": 2.64, | |
| "grad_norm": 0.2087363600730896, | |
| "learning_rate": 3.4042553191489365e-05, | |
| "loss": 0.1876, | |
| "step": 50 | |
| } | |
| ], | |
| "logging_steps": 10, | |
| "max_steps": 57, | |
| "num_input_tokens_seen": 0, | |
| "num_train_epochs": 3, | |
| "save_steps": 50, | |
| "stateful_callbacks": { | |
| "TrainerControl": { | |
| "args": { | |
| "should_epoch_stop": false, | |
| "should_evaluate": false, | |
| "should_log": false, | |
| "should_save": true, | |
| "should_training_stop": false | |
| }, | |
| "attributes": {} | |
| } | |
| }, | |
| "total_flos": 6.920483063935795e+16, | |
| "train_batch_size": 2, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |