Instructions to use whynlp/pccot-llama1b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use whynlp/pccot-llama1b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="whynlp/pccot-llama1b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("whynlp/pccot-llama1b", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use whynlp/pccot-llama1b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "whynlp/pccot-llama1b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "whynlp/pccot-llama1b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/whynlp/pccot-llama1b
- SGLang
How to use whynlp/pccot-llama1b 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 "whynlp/pccot-llama1b" \ --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": "whynlp/pccot-llama1b", "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 "whynlp/pccot-llama1b" \ --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": "whynlp/pccot-llama1b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use whynlp/pccot-llama1b with Docker Model Runner:
docker model run hf.co/whynlp/pccot-llama1b
Upload config
Browse files- pccot_args.json +15 -0
pccot_args.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bot_token_id": 128256,
|
| 3 |
+
"eot_token_id": 128257,
|
| 4 |
+
"latent_token_id": 128258,
|
| 5 |
+
"label_pad_token_id": -100,
|
| 6 |
+
"use_chat_template": false,
|
| 7 |
+
"answer_prompt": "The answer is:",
|
| 8 |
+
"num_latent_tokens": 24,
|
| 9 |
+
"use_peft": true,
|
| 10 |
+
"lora_r": 128,
|
| 11 |
+
"lora_alpha": 32,
|
| 12 |
+
"lora_dropout": 0.1,
|
| 13 |
+
"lora_target_modules": "q_proj-k_proj-v_proj-o_proj-down_proj-up_proj-gate_proj",
|
| 14 |
+
"lora_modules_to_save": ""
|
| 15 |
+
}
|