Text Generation
Transformers
Safetensors
English
qwen2
text-generation-inference
unsloth
conversational
Instructions to use ubetu/Qwen2.5-Coder-0.5B-Instruct-code-lora-try with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ubetu/Qwen2.5-Coder-0.5B-Instruct-code-lora-try with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ubetu/Qwen2.5-Coder-0.5B-Instruct-code-lora-try") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ubetu/Qwen2.5-Coder-0.5B-Instruct-code-lora-try") model = AutoModelForCausalLM.from_pretrained("ubetu/Qwen2.5-Coder-0.5B-Instruct-code-lora-try", device_map="auto") 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 Settings
- vLLM
How to use ubetu/Qwen2.5-Coder-0.5B-Instruct-code-lora-try with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ubetu/Qwen2.5-Coder-0.5B-Instruct-code-lora-try" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ubetu/Qwen2.5-Coder-0.5B-Instruct-code-lora-try", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ubetu/Qwen2.5-Coder-0.5B-Instruct-code-lora-try
- SGLang
How to use ubetu/Qwen2.5-Coder-0.5B-Instruct-code-lora-try 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 "ubetu/Qwen2.5-Coder-0.5B-Instruct-code-lora-try" \ --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": "ubetu/Qwen2.5-Coder-0.5B-Instruct-code-lora-try", "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 "ubetu/Qwen2.5-Coder-0.5B-Instruct-code-lora-try" \ --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": "ubetu/Qwen2.5-Coder-0.5B-Instruct-code-lora-try", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use ubetu/Qwen2.5-Coder-0.5B-Instruct-code-lora-try with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for ubetu/Qwen2.5-Coder-0.5B-Instruct-code-lora-try to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for ubetu/Qwen2.5-Coder-0.5B-Instruct-code-lora-try to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for ubetu/Qwen2.5-Coder-0.5B-Instruct-code-lora-try to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="ubetu/Qwen2.5-Coder-0.5B-Instruct-code-lora-try", max_seq_length=2048, ) - Docker Model Runner
How to use ubetu/Qwen2.5-Coder-0.5B-Instruct-code-lora-try with Docker Model Runner:
docker model run hf.co/ubetu/Qwen2.5-Coder-0.5B-Instruct-code-lora-try
File size: 666 Bytes
ba084cf | 1 2 3 4 5 6 7 8 9 | loss,grad_norm,learning_rate,epoch,step,train_runtime,train_samples_per_second,train_steps_per_second,total_flos,train_loss
0.6067,0.09529262036085129,0.00019548645447466431,0.15151515151515152,20,,,,,
0.5244,0.08185342699289322,0.0001693653305812805,0.30303030303030304,40,,,,,
0.5103,0.0840766653418541,0.00012608415062898972,0.45454545454545453,60,,,,,
0.5031,0.10127674043178558,7.635010029762756e-05,0.6060606060606061,80,,,,,
0.5053,0.0896340161561966,3.246671918789755e-05,0.7575757575757576,100,,,,,
0.4995,0.0959719642996788,5.290169500525577e-06,0.9090909090909091,120,,,,,
,,,1.0,132,256.0028,65.847,0.516,3.045274619748096e+16,0.5222667166681001
|