Text Generation
Transformers
Safetensors
English
qwen2
pretrained
quantized
4-bit precision
AWQ
chatml
conversational
text-generation-inference
awq
Instructions to use solidrust/CodeQwen1.5-7B-AWQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use solidrust/CodeQwen1.5-7B-AWQ with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="solidrust/CodeQwen1.5-7B-AWQ") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("solidrust/CodeQwen1.5-7B-AWQ") model = AutoModelForCausalLM.from_pretrained("solidrust/CodeQwen1.5-7B-AWQ") 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
- vLLM
How to use solidrust/CodeQwen1.5-7B-AWQ with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "solidrust/CodeQwen1.5-7B-AWQ" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "solidrust/CodeQwen1.5-7B-AWQ", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/solidrust/CodeQwen1.5-7B-AWQ
- SGLang
How to use solidrust/CodeQwen1.5-7B-AWQ 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 "solidrust/CodeQwen1.5-7B-AWQ" \ --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": "solidrust/CodeQwen1.5-7B-AWQ", "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 "solidrust/CodeQwen1.5-7B-AWQ" \ --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": "solidrust/CodeQwen1.5-7B-AWQ", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use solidrust/CodeQwen1.5-7B-AWQ with Docker Model Runner:
docker model run hf.co/solidrust/CodeQwen1.5-7B-AWQ
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
license_name: tongyi-qianwen-research
|
| 4 |
+
license_link: >-
|
| 5 |
+
https://huggingface.co/Qwen/CodeQwen1.5-7B/blob/main/LICENSE
|
| 6 |
+
language:
|
| 7 |
+
- en
|
| 8 |
+
pipeline_tag: text-generation
|
| 9 |
+
tags:
|
| 10 |
+
- pretrained
|
| 11 |
+
- quantized
|
| 12 |
+
- 4-bit
|
| 13 |
+
- AWQ
|
| 14 |
+
- text-generation
|
| 15 |
+
- autotrain_compatible
|
| 16 |
+
- endpoints_compatible
|
| 17 |
+
- chatml
|
| 18 |
+
inference: false
|
| 19 |
+
quantized_by: Suparious
|
| 20 |
+
---
|
| 21 |
+
# Qwen/CodeQwen1.5-7B AWQ
|
| 22 |
+
|
| 23 |
+
- Model creator: [Qwen](https://huggingface.co/Qwen)
|
| 24 |
+
- Original model: [CodeQwen1.5-7B](https://huggingface.co/Qwen/CodeQwen1.5-7B)
|
| 25 |
+
|
| 26 |
+
## Model Summary
|
| 27 |
+
|
| 28 |
+
CodeQwen1.5 is the Code-Specific version of Qwen1.5. It is a transformer-based decoder-only language model pretrained on a large amount of data of codes.
|
| 29 |
+
|
| 30 |
+
* Strong code generation capabilities and competitve performance across a series of benchmarks;
|
| 31 |
+
* Supporting long context understanding and generation with the context length of 64K tokens;
|
| 32 |
+
* Supporting 92 coding languages
|
| 33 |
+
* Excellent performance in text-to-SQL, bug fix, etc.
|
| 34 |
+
|
| 35 |
+
For more details, please refer to our [blog post](https://qwenlm.github.io/blog/codeqwen1.5/) and [GitHub repo](https://github.com/QwenLM/Qwen1.5).
|
| 36 |
+
|
| 37 |
+
```
|
| 38 |
+
@article{qwen,
|
| 39 |
+
title={Qwen Technical Report},
|
| 40 |
+
author={Jinze Bai and Shuai Bai and Yunfei Chu and Zeyu Cui and Kai Dang and Xiaodong Deng and Yang Fan and Wenbin Ge and Yu Han and Fei Huang and Binyuan Hui and Luo Ji and Mei Li and Junyang Lin and Runji Lin and Dayiheng Liu and Gao Liu and Chengqiang Lu and Keming Lu and Jianxin Ma and Rui Men and Xingzhang Ren and Xuancheng Ren and Chuanqi Tan and Sinan Tan and Jianhong Tu and Peng Wang and Shijie Wang and Wei Wang and Shengguang Wu and Benfeng Xu and Jin Xu and An Yang and Hao Yang and Jian Yang and Shusheng Yang and Yang Yao and Bowen Yu and Hongyi Yuan and Zheng Yuan and Jianwei Zhang and Xingxuan Zhang and Yichang Zhang and Zhenru Zhang and Chang Zhou and Jingren Zhou and Xiaohuan Zhou and Tianhang Zhu},
|
| 41 |
+
journal={arXiv preprint arXiv:2309.16609},
|
| 42 |
+
year={2023}
|
| 43 |
+
}
|
| 44 |
+
```
|