Text Generation
Transformers
Safetensors
qwen3_5_text
techwithsergiu
conversational
4-bit precision
bitsandbytes
Instructions to use techwithsergiu/Qwen3.5-text-9B-bnb-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use techwithsergiu/Qwen3.5-text-9B-bnb-4bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="techwithsergiu/Qwen3.5-text-9B-bnb-4bit") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("techwithsergiu/Qwen3.5-text-9B-bnb-4bit") model = AutoModelForCausalLM.from_pretrained("techwithsergiu/Qwen3.5-text-9B-bnb-4bit", 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 techwithsergiu/Qwen3.5-text-9B-bnb-4bit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "techwithsergiu/Qwen3.5-text-9B-bnb-4bit" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "techwithsergiu/Qwen3.5-text-9B-bnb-4bit", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/techwithsergiu/Qwen3.5-text-9B-bnb-4bit
- SGLang
How to use techwithsergiu/Qwen3.5-text-9B-bnb-4bit 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 "techwithsergiu/Qwen3.5-text-9B-bnb-4bit" \ --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": "techwithsergiu/Qwen3.5-text-9B-bnb-4bit", "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 "techwithsergiu/Qwen3.5-text-9B-bnb-4bit" \ --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": "techwithsergiu/Qwen3.5-text-9B-bnb-4bit", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use techwithsergiu/Qwen3.5-text-9B-bnb-4bit with Docker Model Runner:
docker model run hf.co/techwithsergiu/Qwen3.5-text-9B-bnb-4bit
docs: replace TBD fine-tuning section with qwen-qlora-train quick start
Browse files- README.md +25 -9
- diagrams/diagram_02.png +2 -2
README.md
CHANGED
|
@@ -92,15 +92,31 @@ print(response)
|
|
| 92 |
|
| 93 |
## Fine-tuning
|
| 94 |
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 104 |
|
| 105 |
## Pipeline diagram
|
| 106 |
|
|
|
|
| 92 |
|
| 93 |
## Fine-tuning
|
| 94 |
|
| 95 |
+
This is the **primary training target** for text LoRA fine-tuning.
|
| 96 |
+
|
| 97 |
+
Training pipeline: **[github.com/techwithsergiu/qwen-qlora-train](https://github.com/techwithsergiu/qwen-qlora-train)**
|
| 98 |
+
|
| 99 |
+
QLoRA (Unsloth + TRL + PEFT) · rank 16–64 · validated on RTX 3070 8 GB
|
| 100 |
+
|
| 101 |
+
```bash
|
| 102 |
+
# Quick start — install
|
| 103 |
+
pip install "unsloth[cu124-torch260] @ git+https://github.com/unslothai/unsloth.git"
|
| 104 |
+
pip install git+https://github.com/techwithsergiu/qwen-qlora-train.git
|
| 105 |
+
|
| 106 |
+
# Train with a ready-made config
|
| 107 |
+
qlora-train configs/qwen35/0.8b.yaml # or 2b / 4b
|
| 108 |
+
```
|
| 109 |
+
|
| 110 |
+
After training, test the adapter without merging:
|
| 111 |
+
|
| 112 |
+
```bash
|
| 113 |
+
qlora-infer \
|
| 114 |
+
--model techwithsergiu/Qwen3.5-text-9B-bnb-4bit \
|
| 115 |
+
--adapter adapters/<run_name>
|
| 116 |
+
```
|
| 117 |
+
|
| 118 |
+
For VLM (image + text) fine-tuning of the full model, see:
|
| 119 |
+
[unsloth.ai/docs/models/qwen3.5/fine-tune](https://unsloth.ai/docs/models/qwen3.5/fine-tune)
|
| 120 |
|
| 121 |
## Pipeline diagram
|
| 122 |
|
diagrams/diagram_02.png
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|