Instructions to use Kalaphant/KalaBot with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Kalaphant/KalaBot with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Kalaphant/KalaBot")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Kalaphant/KalaBot") model = AutoModelForCausalLM.from_pretrained("Kalaphant/KalaBot") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Kalaphant/KalaBot with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Kalaphant/KalaBot" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kalaphant/KalaBot", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Kalaphant/KalaBot
- SGLang
How to use Kalaphant/KalaBot 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 "Kalaphant/KalaBot" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kalaphant/KalaBot", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "Kalaphant/KalaBot" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kalaphant/KalaBot", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Kalaphant/KalaBot with Docker Model Runner:
docker model run hf.co/Kalaphant/KalaBot
Update config.json
Browse files- config.json +28 -0
config.json
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model_type": "bert", // Specify the type of model (e.g., bert, gpt, etc.)
|
| 3 |
+
"vocabulary_size": 30522, // Vocabulary size of the model
|
| 4 |
+
"hidden_size": 768, // Size of the hidden layers
|
| 5 |
+
"num_attention_heads": 12, // Number of attention heads in the model
|
| 6 |
+
"num_hidden_layers": 12, // Number of hidden layers in the model
|
| 7 |
+
"intermediate_size": 3072, // Size of the intermediate layers
|
| 8 |
+
"activation_function": "gelu", // Activation function used in the model
|
| 9 |
+
"initializer_range": 0.02, // Standard deviation of the truncated_normal_initializer
|
| 10 |
+
"layer_norm_eps": 1e-12, // Epsilon value for layer normalization
|
| 11 |
+
"max_position_embeddings": 512, // Maximum length of sequences
|
| 12 |
+
"tokenizer_type": "WordPiece", // Type of tokenizer used
|
| 13 |
+
"special_tokens": {
|
| 14 |
+
"pad_token": "[PAD]", // Padding token
|
| 15 |
+
"unk_token": "[UNK]", // Unknown token
|
| 16 |
+
"cls_token": "[CLS]", // Classification token
|
| 17 |
+
"sep_token": "[SEP]", // Separator token
|
| 18 |
+
"mask_token": "[MASK]" // Masking token
|
| 19 |
+
},
|
| 20 |
+
"dropout_rate": 0.1, // Dropout rate for regularization
|
| 21 |
+
"learning_rate": 0.00005, // Learning rate for training
|
| 22 |
+
"optimizer": "adamw", // Optimizer used during training
|
| 23 |
+
"num_labels": 2, // Number of labels for classification tasks
|
| 24 |
+
"train_batch_size": 16, // Batch size for training
|
| 25 |
+
"eval_batch_size": 32, // Batch size for evaluation
|
| 26 |
+
"epochs": 3, // Number of epochs for training
|
| 27 |
+
"early_stopping_patience": 3 // Patience for early stopping
|
| 28 |
+
}
|