Text Generation
Transformers
Safetensors
English
qwen2
python
code-generation
lora
conversational
text-generation-inference
Instructions to use Noor-Khan/python-coder-3b-research with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Noor-Khan/python-coder-3b-research with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Noor-Khan/python-coder-3b-research") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Noor-Khan/python-coder-3b-research") model = AutoModelForCausalLM.from_pretrained("Noor-Khan/python-coder-3b-research", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Noor-Khan/python-coder-3b-research with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Noor-Khan/python-coder-3b-research" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Noor-Khan/python-coder-3b-research", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Noor-Khan/python-coder-3b-research
- SGLang
How to use Noor-Khan/python-coder-3b-research 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 "Noor-Khan/python-coder-3b-research" \ --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": "Noor-Khan/python-coder-3b-research", "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 "Noor-Khan/python-coder-3b-research" \ --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": "Noor-Khan/python-coder-3b-research", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Noor-Khan/python-coder-3b-research with Docker Model Runner:
docker model run hf.co/Noor-Khan/python-coder-3b-research
File size: 661 Bytes
ba84daf | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | Qwen is licensed under the Qwen RESEARCH LICENSE AGREEMENT, Copyright (c) Alibaba Cloud. All Rights Reserved.
Built with Qwen.
Source: Qwen/Qwen2.5-3B-Instruct, via
huihui-ai/Qwen2.5-3B-Instruct-abliterated-SFT
revision e21343fbcabbb6225d1cb9122061404f2d21f1ad.
Modification notice
All four model-*.safetensors files were exported after merging the Python LoRA
fine-tuning updates into the source checkpoint. The shard index, model and
generation configurations, tokenizer files, and chat template were serialized
for this Transformers export. README.md, NOTICE, and evaluation.json document
the resulting release. See LICENSE for the redistribution terms.
|