Instructions to use unamedai/KateAI with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use unamedai/KateAI with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="unamedai/KateAI")# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("unamedai/KateAI", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use unamedai/KateAI with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "unamedai/KateAI" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "unamedai/KateAI", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/unamedai/KateAI
- SGLang
How to use unamedai/KateAI 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 "unamedai/KateAI" \ --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": "unamedai/KateAI", "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 "unamedai/KateAI" \ --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": "unamedai/KateAI", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use unamedai/KateAI with Docker Model Runner:
docker model run hf.co/unamedai/KateAI
Update config.json
Browse files- config.json +48 -32
config.json
CHANGED
|
@@ -1,33 +1,49 @@
|
|
| 1 |
{
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
"
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
{
|
| 2 |
+
"model_type": "custom_transformer",
|
| 3 |
+
"architectures": ["CustomTransformer"],
|
| 4 |
+
"vocab_size": 50257,
|
| 5 |
+
"hidden_size": 768,
|
| 6 |
+
"num_hidden_layers": 8,
|
| 7 |
+
"num_attention_heads": 8,
|
| 8 |
+
"intermediate_size": 3072,
|
| 9 |
+
"hidden_act": "gelu",
|
| 10 |
+
"hidden_dropout_prob": 0.1,
|
| 11 |
+
"max_position_embeddings": 512,
|
| 12 |
+
"initializer_range": 0.02,
|
| 13 |
+
"layer_norm_eps": 1e-12,
|
| 14 |
+
"pad_token_id": 50256,
|
| 15 |
+
"bos_token_id": 50256,
|
| 16 |
+
"eos_token_id": 50256,
|
| 17 |
+
"transformers_version": "4.28.1",
|
| 18 |
+
"rl_params": {
|
| 19 |
+
"clip_epsilon": 0.2,
|
| 20 |
+
"value_coef": 0.5,
|
| 21 |
+
"entropy_coef": 0.01,
|
| 22 |
+
"ppo_epochs": 4,
|
| 23 |
+
"gamma": 0.99,
|
| 24 |
+
"lam": 0.95
|
| 25 |
+
},
|
| 26 |
+
"training_params": {
|
| 27 |
+
"learning_rate": 5e-5,
|
| 28 |
+
"train_batch_size": 32,
|
| 29 |
+
"warmup_steps": 500,
|
| 30 |
+
"weight_decay": 0.01,
|
| 31 |
+
"max_grad_norm": 1.0,
|
| 32 |
+
"lr_scheduler_type": "cosine"
|
| 33 |
+
},
|
| 34 |
+
"dataset_params": {
|
| 35 |
+
"name": "roneneldan/TinyStories",
|
| 36 |
+
"max_seq_length": 512,
|
| 37 |
+
"text_column": "text",
|
| 38 |
+
"subset_percentage": 10
|
| 39 |
+
},
|
| 40 |
+
"tokenizer_params": {
|
| 41 |
+
"pretrained_tokenizer": "gpt2",
|
| 42 |
+
"padding_side": "right"
|
| 43 |
+
},
|
| 44 |
+
"reward_model": {
|
| 45 |
+
"model_name": "distilbert-base-uncased",
|
| 46 |
+
"num_labels": 1,
|
| 47 |
+
"score_threshold": 0.5
|
| 48 |
+
}
|
| 49 |
+
}
|