Instructions to use NTQAI/Nxcode-CQ-7B-orpo with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NTQAI/Nxcode-CQ-7B-orpo with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="NTQAI/Nxcode-CQ-7B-orpo") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("NTQAI/Nxcode-CQ-7B-orpo") model = AutoModelForCausalLM.from_pretrained("NTQAI/Nxcode-CQ-7B-orpo") 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 NTQAI/Nxcode-CQ-7B-orpo with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NTQAI/Nxcode-CQ-7B-orpo" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NTQAI/Nxcode-CQ-7B-orpo", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/NTQAI/Nxcode-CQ-7B-orpo
- SGLang
How to use NTQAI/Nxcode-CQ-7B-orpo 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 "NTQAI/Nxcode-CQ-7B-orpo" \ --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": "NTQAI/Nxcode-CQ-7B-orpo", "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 "NTQAI/Nxcode-CQ-7B-orpo" \ --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": "NTQAI/Nxcode-CQ-7B-orpo", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use NTQAI/Nxcode-CQ-7B-orpo with Docker Model Runner:
docker model run hf.co/NTQAI/Nxcode-CQ-7B-orpo
hoang.dang1 commited on
Commit ·
6d0c0e4
1
Parent(s): 2543b5b
upload model
Browse files- config.json +3 -0
- generation_config.json +3 -0
- model-00001-of-00002.safetensors +3 -0
- model-00002-of-00002.safetensors +3 -0
- model.safetensors.index.json +3 -0
- special_tokens_map.json +3 -0
- tokenizer.json +3 -0
- tokenizer_config.json +3 -0
config.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:12d87f226fcc758097c0382c2c169947b311bf286cbb3a09e82795f32bf14869
|
| 3 |
+
size 790
|
generation_config.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:48e22dffca285c4bbc0bcba1f88803205d5c81808e680111361f178db3df91aa
|
| 3 |
+
size 161
|
model-00001-of-00002.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3ac6737eb0ad69bb2826d308676ab5d59396ff5896328e72b0f615d068a6db37
|
| 3 |
+
size 7951839160
|
model-00002-of-00002.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:465fdbdd33c78a0674b263f9d50fd897b6b3bcdbec3598f3394dd3b0e67b9a97
|
| 3 |
+
size 6548774312
|
model.safetensors.index.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:dc70aaad114ba0ad861bb83c028da9de0905d2c3224e6b09c8e87f254768e9df
|
| 3 |
+
size 31696
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0a4dd5170d555577508428f0bbbf978a023988b751b41104ef1f83d8c7becabe
|
| 3 |
+
size 724
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2c76138a6f0445fae419c97baa48cb5b29a9ccbb71365711bc630d9f7c4a40bc
|
| 3 |
+
size 4463016
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0ddcdeb4f0f7c7b19c02b44b9c1cfb5b60c6172d2d723ad7c0c4498395e43f72
|
| 3 |
+
size 237403
|