Text Generation
Transformers
Safetensors
English
stablelm_epoch
gpt
llm
large language model
PAIX.Cloud
custom_code
Instructions to use PAIXAI/Astrid-3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PAIXAI/Astrid-3B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="PAIXAI/Astrid-3B", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("PAIXAI/Astrid-3B", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use PAIXAI/Astrid-3B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PAIXAI/Astrid-3B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PAIXAI/Astrid-3B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/PAIXAI/Astrid-3B
- SGLang
How to use PAIXAI/Astrid-3B 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 "PAIXAI/Astrid-3B" \ --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": "PAIXAI/Astrid-3B", "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 "PAIXAI/Astrid-3B" \ --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": "PAIXAI/Astrid-3B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use PAIXAI/Astrid-3B with Docker Model Runner:
docker model run hf.co/PAIXAI/Astrid-3B
Upload cfg.yaml
Browse files
cfg.yaml
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
architecture:
|
| 2 |
+
backbone_dtype: int4
|
| 3 |
+
force_embedding_gradients: false
|
| 4 |
+
gradient_checkpointing: true
|
| 5 |
+
intermediate_dropout: 0.0
|
| 6 |
+
pretrained: true
|
| 7 |
+
pretrained_weights: ''
|
| 8 |
+
augmentation:
|
| 9 |
+
random_parent_probability: 0.0
|
| 10 |
+
skip_parent_probability: 0.0
|
| 11 |
+
token_mask_probability: 0.0
|
| 12 |
+
dataset:
|
| 13 |
+
add_eos_token_to_answer: true
|
| 14 |
+
add_eos_token_to_prompt: true
|
| 15 |
+
add_eos_token_to_system: true
|
| 16 |
+
answer_column: output
|
| 17 |
+
chatbot_author: PAIX.Cloud
|
| 18 |
+
chatbot_name: Astrid
|
| 19 |
+
data_sample: 1.0
|
| 20 |
+
data_sample_choice:
|
| 21 |
+
- Train
|
| 22 |
+
- Validation
|
| 23 |
+
limit_chained_samples: false
|
| 24 |
+
mask_prompt_labels: true
|
| 25 |
+
parent_id_column: None
|
| 26 |
+
personalize: true
|
| 27 |
+
prompt_column:
|
| 28 |
+
- instruction
|
| 29 |
+
system_column: None
|
| 30 |
+
text_answer_separator: <|answer|>
|
| 31 |
+
text_prompt_start: <|prompt|>
|
| 32 |
+
text_system_start: <|system|>
|
| 33 |
+
train_dataframe: /workspace/data/user/oasst/train_full.pq
|
| 34 |
+
validation_dataframe: None
|
| 35 |
+
validation_size: 0.01
|
| 36 |
+
validation_strategy: automatic
|
| 37 |
+
environment:
|
| 38 |
+
compile_model: false
|
| 39 |
+
find_unused_parameters: false
|
| 40 |
+
gpus:
|
| 41 |
+
- '0'
|
| 42 |
+
huggingface_branch: main
|
| 43 |
+
mixed_precision: true
|
| 44 |
+
number_of_workers: 8
|
| 45 |
+
seed: -1
|
| 46 |
+
trust_remote_code: true
|
| 47 |
+
use_fsdp: false
|
| 48 |
+
experiment_name: Astrid-3B
|
| 49 |
+
llm_backbone: stabilityai/stablelm-3b-4e1t
|
| 50 |
+
logging:
|
| 51 |
+
logger: Neptune
|
| 52 |
+
neptune_project: daviess/paix
|
| 53 |
+
output_directory: /workspace/output/user/Astrid-3B/
|
| 54 |
+
prediction:
|
| 55 |
+
batch_size_inference: 0
|
| 56 |
+
do_sample: false
|
| 57 |
+
max_length_inference: 256
|
| 58 |
+
metric: GPT
|
| 59 |
+
metric_gpt_model: gpt-3.5-turbo-0301
|
| 60 |
+
min_length_inference: 2
|
| 61 |
+
num_beams: 1
|
| 62 |
+
num_history: 4
|
| 63 |
+
repetition_penalty: 1.2
|
| 64 |
+
stop_tokens: ''
|
| 65 |
+
temperature: 0.3
|
| 66 |
+
top_k: 0
|
| 67 |
+
top_p: 1.0
|
| 68 |
+
problem_type: text_causal_language_modeling
|
| 69 |
+
tokenizer:
|
| 70 |
+
add_prefix_space: false
|
| 71 |
+
add_prompt_answer_tokens: false
|
| 72 |
+
max_length: 512
|
| 73 |
+
max_length_answer: 256
|
| 74 |
+
max_length_prompt: 256
|
| 75 |
+
padding_quantile: 1.0
|
| 76 |
+
use_fast: true
|
| 77 |
+
training:
|
| 78 |
+
batch_size: 2
|
| 79 |
+
differential_learning_rate: 1.0e-05
|
| 80 |
+
differential_learning_rate_layers: []
|
| 81 |
+
drop_last_batch: true
|
| 82 |
+
epochs: 1
|
| 83 |
+
evaluate_before_training: false
|
| 84 |
+
evaluation_epochs: 1.0
|
| 85 |
+
grad_accumulation: 1
|
| 86 |
+
gradient_clip: 0.0
|
| 87 |
+
learning_rate: 0.0001
|
| 88 |
+
lora: true
|
| 89 |
+
lora_alpha: 16
|
| 90 |
+
lora_dropout: 0.05
|
| 91 |
+
lora_r: 4
|
| 92 |
+
lora_target_modules: ''
|
| 93 |
+
loss_function: TokenAveragedCrossEntropy
|
| 94 |
+
optimizer: AdamW
|
| 95 |
+
save_best_checkpoint: false
|
| 96 |
+
schedule: Cosine
|
| 97 |
+
train_validation_data: false
|
| 98 |
+
warmup_epochs: 0.0
|
| 99 |
+
weight_decay: 0.0
|