Instructions to use K-saif/apj-kalam-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use K-saif/apj-kalam-instruct with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("kalam_cpt_merged") model = PeftModel.from_pretrained(base_model, "K-saif/apj-kalam-instruct") - Transformers
How to use K-saif/apj-kalam-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="K-saif/apj-kalam-instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("K-saif/apj-kalam-instruct", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use K-saif/apj-kalam-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "K-saif/apj-kalam-instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "K-saif/apj-kalam-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/K-saif/apj-kalam-instruct
- SGLang
How to use K-saif/apj-kalam-instruct 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 "K-saif/apj-kalam-instruct" \ --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": "K-saif/apj-kalam-instruct", "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 "K-saif/apj-kalam-instruct" \ --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": "K-saif/apj-kalam-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use K-saif/apj-kalam-instruct with Docker Model Runner:
docker model run hf.co/K-saif/apj-kalam-instruct
Upload folder using huggingface_hub
Browse files
README.md
CHANGED
|
@@ -25,35 +25,39 @@ This model was trained using a multi-stage pipeline:
|
|
| 25 |
1. Continued Pretraining (CPT)
|
| 26 |
2. CPT merge into base model
|
| 27 |
3. Supervised Fine-Tuning (SFT)
|
| 28 |
-
|
| 29 |
|
| 30 |
## Base Model
|
| 31 |
- Qwen/Qwen2.5-7B
|
| 32 |
-
|
| 33 |
|
| 34 |
## Personality & Style
|
|
|
|
| 35 |
The model is designed to:
|
| 36 |
- Speak with humility and simplicity
|
| 37 |
- Inspire students and young people
|
| 38 |
- Discuss science, education, leadership, and life philosophy
|
| 39 |
- Answer in first-person style as Dr. APJ Abdul Kalam
|
| 40 |
-
|
| 41 |
|
| 42 |
## Example
|
| 43 |
### User
|
| 44 |
who are you?
|
| 45 |
|
| 46 |
### Assistant
|
|
|
|
| 47 |
I am Dr. Abdul Kalam, former President of India, born on October 15, 1931, in Rameswaram, Tamil Nadu. I come from a humble background and have had many life experiences that have shaped my worldview.
|
| 48 |
-
|
| 49 |
|
| 50 |
## Training Details
|
| 51 |
### Continued Pretraining (CPT)
|
|
|
|
| 52 |
The model first underwent domain adaptation on Kalam-style writings and philosophical content.
|
| 53 |
|
| 54 |
### SFT
|
|
|
|
| 55 |
The model was then instruction-tuned using conversational datasets in chat format.
|
| 56 |
-
|
| 57 |
|
| 58 |
## Known Limitations
|
| 59 |
This is the initial v1 release.
|
|
@@ -67,7 +71,7 @@ Future versions may improve:
|
|
| 67 |
- conversational depth
|
| 68 |
- long-form reasoning
|
| 69 |
- response consistency
|
| 70 |
-
|
| 71 |
|
| 72 |
## Recommended Inference Settings
|
| 73 |
For best response quality:
|
|
@@ -159,7 +163,6 @@ response = tokenizer.decode(
|
|
| 159 |
|
| 160 |
print(response)
|
| 161 |
```
|
| 162 |
-
---
|
| 163 |
|
| 164 |
## Intended Use
|
| 165 |
This model is intended for:
|
|
@@ -174,7 +177,7 @@ Not intended for:
|
|
| 174 |
* factual historical accuracy
|
| 175 |
* legal/medical advice
|
| 176 |
* sensitive decision making
|
| 177 |
-
|
| 178 |
|
| 179 |
## Author
|
| 180 |
Developed by Saif Khan.
|
|
|
|
| 25 |
1. Continued Pretraining (CPT)
|
| 26 |
2. CPT merge into base model
|
| 27 |
3. Supervised Fine-Tuning (SFT)
|
| 28 |
+
|
| 29 |
|
| 30 |
## Base Model
|
| 31 |
- Qwen/Qwen2.5-7B
|
| 32 |
+
|
| 33 |
|
| 34 |
## Personality & Style
|
| 35 |
+
|
| 36 |
The model is designed to:
|
| 37 |
- Speak with humility and simplicity
|
| 38 |
- Inspire students and young people
|
| 39 |
- Discuss science, education, leadership, and life philosophy
|
| 40 |
- Answer in first-person style as Dr. APJ Abdul Kalam
|
| 41 |
+
|
| 42 |
|
| 43 |
## Example
|
| 44 |
### User
|
| 45 |
who are you?
|
| 46 |
|
| 47 |
### Assistant
|
| 48 |
+
|
| 49 |
I am Dr. Abdul Kalam, former President of India, born on October 15, 1931, in Rameswaram, Tamil Nadu. I come from a humble background and have had many life experiences that have shaped my worldview.
|
| 50 |
+
|
| 51 |
|
| 52 |
## Training Details
|
| 53 |
### Continued Pretraining (CPT)
|
| 54 |
+
|
| 55 |
The model first underwent domain adaptation on Kalam-style writings and philosophical content.
|
| 56 |
|
| 57 |
### SFT
|
| 58 |
+
|
| 59 |
The model was then instruction-tuned using conversational datasets in chat format.
|
| 60 |
+
|
| 61 |
|
| 62 |
## Known Limitations
|
| 63 |
This is the initial v1 release.
|
|
|
|
| 71 |
- conversational depth
|
| 72 |
- long-form reasoning
|
| 73 |
- response consistency
|
| 74 |
+
|
| 75 |
|
| 76 |
## Recommended Inference Settings
|
| 77 |
For best response quality:
|
|
|
|
| 163 |
|
| 164 |
print(response)
|
| 165 |
```
|
|
|
|
| 166 |
|
| 167 |
## Intended Use
|
| 168 |
This model is intended for:
|
|
|
|
| 177 |
* factual historical accuracy
|
| 178 |
* legal/medical advice
|
| 179 |
* sensitive decision making
|
| 180 |
+
|
| 181 |
|
| 182 |
## Author
|
| 183 |
Developed by Saif Khan.
|