Text Generation
Transformers
Safetensors
English
qwen2
Coder
Math
thinking
reasoning
conversational
text-generation-inference
Instructions to use Writer/palmyra-mini-thinking-a with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Writer/palmyra-mini-thinking-a with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Writer/palmyra-mini-thinking-a") 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("Writer/palmyra-mini-thinking-a") model = AutoModelForCausalLM.from_pretrained("Writer/palmyra-mini-thinking-a", 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 Writer/palmyra-mini-thinking-a with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Writer/palmyra-mini-thinking-a" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Writer/palmyra-mini-thinking-a", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Writer/palmyra-mini-thinking-a
- SGLang
How to use Writer/palmyra-mini-thinking-a 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 "Writer/palmyra-mini-thinking-a" \ --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": "Writer/palmyra-mini-thinking-a", "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 "Writer/palmyra-mini-thinking-a" \ --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": "Writer/palmyra-mini-thinking-a", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Writer/palmyra-mini-thinking-a with Docker Model Runner:
docker model run hf.co/Writer/palmyra-mini-thinking-a
Update README.md
Browse files
README.md
CHANGED
|
@@ -15,13 +15,13 @@ language:
|
|
| 15 |
|
| 16 |
# Model: palmyra-mini-thinking-a
|
| 17 |
|
| 18 |
-
## Model
|
| 19 |
|
| 20 |
-
**
|
| 21 |
-
|
| 22 |
-
**
|
| 23 |
-
|
| 24 |
-
**
|
| 25 |
|
| 26 |
|
| 27 |
## Model Description
|
|
@@ -106,6 +106,28 @@ output_text = tokenizer.decode(output_id[0][input_ids.shape[1] :])
|
|
| 106 |
print(output_text)
|
| 107 |
```
|
| 108 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
|
| 110 |
## Ethical Considerations
|
| 111 |
|
|
|
|
| 15 |
|
| 16 |
# Model: palmyra-mini-thinking-a
|
| 17 |
|
| 18 |
+
### Model Description
|
| 19 |
|
| 20 |
+
- **Language(s) (NLP):** English
|
| 21 |
+
- **License:** Apache-2.0
|
| 22 |
+
- **Finetuned from model:** Qwen/Qwen2.5-1.5B
|
| 23 |
+
- **Context window:** 131,072 tokens
|
| 24 |
+
- **Parameters:** 1.7 billion
|
| 25 |
|
| 26 |
|
| 27 |
## Model Description
|
|
|
|
| 106 |
print(output_text)
|
| 107 |
```
|
| 108 |
|
| 109 |
+
## curl Instructions
|
| 110 |
+
```py
|
| 111 |
+
curl -X POST http://localhost:8000/v1/chat/completions \
|
| 112 |
+
-H "Content-Type: application/json" \
|
| 113 |
+
-d '{
|
| 114 |
+
"model": "Writer/palmyra-mini-thinking-a",
|
| 115 |
+
"messages": [
|
| 116 |
+
{
|
| 117 |
+
"role": "user",
|
| 118 |
+
"content": "You have a 3-liter jug and a 5-liter jug. How can you measure exactly 4 liters of water?"
|
| 119 |
+
}
|
| 120 |
+
],
|
| 121 |
+
"max_tokens": 8000,
|
| 122 |
+
"temperature": 0.2
|
| 123 |
+
}'
|
| 124 |
+
```
|
| 125 |
+
|
| 126 |
+
## VLLM Inference
|
| 127 |
+
```py
|
| 128 |
+
vllm serve Writer/palmyra-mini-thinking-a
|
| 129 |
+
```
|
| 130 |
+
|
| 131 |
|
| 132 |
## Ethical Considerations
|
| 133 |
|