Text Generation
PEFT
Safetensors
Transformers
llama
axolotl
lora
conversational
text-generation-inference
4-bit precision
bitsandbytes
Instructions to use AIPixelMedia/astrid with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use AIPixelMedia/astrid with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.1-8B-Instruct") model = PeftModel.from_pretrained(base_model, "AIPixelMedia/astrid") - Transformers
How to use AIPixelMedia/astrid with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AIPixelMedia/astrid") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("AIPixelMedia/astrid") model = AutoModelForCausalLM.from_pretrained("AIPixelMedia/astrid", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use AIPixelMedia/astrid with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AIPixelMedia/astrid" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AIPixelMedia/astrid", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/AIPixelMedia/astrid
- SGLang
How to use AIPixelMedia/astrid 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 "AIPixelMedia/astrid" \ --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": "AIPixelMedia/astrid", "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 "AIPixelMedia/astrid" \ --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": "AIPixelMedia/astrid", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use AIPixelMedia/astrid with Docker Model Runner:
docker model run hf.co/AIPixelMedia/astrid
| { | |
| "best_global_step": 40, | |
| "best_metric": 2.39176344871521, | |
| "best_model_checkpoint": "./outputs/astrid-llama-8b/checkpoint-40", | |
| "epoch": 13.444444444444445, | |
| "eval_steps": 5, | |
| "global_step": 40, | |
| "is_hyper_param_search": false, | |
| "is_local_process_zero": true, | |
| "is_world_process_zero": true, | |
| "log_history": [ | |
| { | |
| "epoch": 0, | |
| "eval_loss": 3.2546439170837402, | |
| "eval_runtime": 3.0517, | |
| "eval_samples_per_second": 7.209, | |
| "eval_steps_per_second": 3.605, | |
| "memory/device_reserved (GiB)": 12.15, | |
| "memory/max_active (GiB)": 11.95, | |
| "memory/max_allocated (GiB)": 11.95, | |
| "step": 0 | |
| }, | |
| { | |
| "epoch": 1.8888888888888888, | |
| "grad_norm": 9.879115104675293, | |
| "learning_rate": 8.000000000000001e-06, | |
| "loss": 3.1725, | |
| "memory/device_reserved (GiB)": 17.46, | |
| "memory/max_active (GiB)": 15.28, | |
| "memory/max_allocated (GiB)": 15.28, | |
| "step": 5, | |
| "tokens_per_second_per_gpu": 606.65 | |
| }, | |
| { | |
| "epoch": 1.8888888888888888, | |
| "eval_loss": 3.214911460876465, | |
| "eval_runtime": 2.571, | |
| "eval_samples_per_second": 8.557, | |
| "eval_steps_per_second": 4.278, | |
| "memory/device_reserved (GiB)": 17.46, | |
| "memory/max_active (GiB)": 12.13, | |
| "memory/max_allocated (GiB)": 12.13, | |
| "step": 5 | |
| }, | |
| { | |
| "epoch": 3.4444444444444446, | |
| "grad_norm": 8.826162338256836, | |
| "learning_rate": 1.8e-05, | |
| "loss": 3.1171, | |
| "memory/device_reserved (GiB)": 16.52, | |
| "memory/max_active (GiB)": 15.28, | |
| "memory/max_allocated (GiB)": 15.28, | |
| "step": 10, | |
| "tokens_per_second_per_gpu": 453.74 | |
| }, | |
| { | |
| "epoch": 3.4444444444444446, | |
| "eval_loss": 2.9428627490997314, | |
| "eval_runtime": 2.5614, | |
| "eval_samples_per_second": 8.589, | |
| "eval_steps_per_second": 4.295, | |
| "memory/device_reserved (GiB)": 16.52, | |
| "memory/max_active (GiB)": 12.13, | |
| "memory/max_allocated (GiB)": 12.13, | |
| "step": 10 | |
| }, | |
| { | |
| "epoch": 5.0, | |
| "grad_norm": 9.603759765625, | |
| "learning_rate": 1.913545457642601e-05, | |
| "loss": 2.6355, | |
| "memory/device_reserved (GiB)": 16.52, | |
| "memory/max_active (GiB)": 15.28, | |
| "memory/max_allocated (GiB)": 15.28, | |
| "step": 15, | |
| "tokens_per_second_per_gpu": 2687.33 | |
| }, | |
| { | |
| "epoch": 5.0, | |
| "eval_loss": 2.639833688735962, | |
| "eval_runtime": 2.5641, | |
| "eval_samples_per_second": 8.58, | |
| "eval_steps_per_second": 4.29, | |
| "memory/device_reserved (GiB)": 16.52, | |
| "memory/max_active (GiB)": 12.13, | |
| "memory/max_allocated (GiB)": 12.13, | |
| "step": 15 | |
| }, | |
| { | |
| "epoch": 6.888888888888889, | |
| "grad_norm": 4.490882873535156, | |
| "learning_rate": 1.5877852522924733e-05, | |
| "loss": 2.3752, | |
| "memory/device_reserved (GiB)": 16.52, | |
| "memory/max_active (GiB)": 15.28, | |
| "memory/max_allocated (GiB)": 15.28, | |
| "step": 20, | |
| "tokens_per_second_per_gpu": 575.3 | |
| }, | |
| { | |
| "epoch": 6.888888888888889, | |
| "eval_loss": 2.5206339359283447, | |
| "eval_runtime": 2.5709, | |
| "eval_samples_per_second": 8.557, | |
| "eval_steps_per_second": 4.279, | |
| "memory/device_reserved (GiB)": 16.52, | |
| "memory/max_active (GiB)": 12.13, | |
| "memory/max_allocated (GiB)": 12.13, | |
| "step": 20 | |
| }, | |
| { | |
| "epoch": 8.444444444444445, | |
| "grad_norm": 3.118549346923828, | |
| "learning_rate": 1.1045284632676535e-05, | |
| "loss": 2.1869, | |
| "memory/device_reserved (GiB)": 16.52, | |
| "memory/max_active (GiB)": 15.28, | |
| "memory/max_allocated (GiB)": 15.28, | |
| "step": 25, | |
| "tokens_per_second_per_gpu": 447.65 | |
| }, | |
| { | |
| "epoch": 8.444444444444445, | |
| "eval_loss": 2.446424961090088, | |
| "eval_runtime": 2.572, | |
| "eval_samples_per_second": 8.554, | |
| "eval_steps_per_second": 4.277, | |
| "memory/device_reserved (GiB)": 16.52, | |
| "memory/max_active (GiB)": 12.13, | |
| "memory/max_allocated (GiB)": 12.13, | |
| "step": 25 | |
| }, | |
| { | |
| "epoch": 10.0, | |
| "grad_norm": 7.509883880615234, | |
| "learning_rate": 5.932633569242e-06, | |
| "loss": 2.0751, | |
| "memory/device_reserved (GiB)": 16.52, | |
| "memory/max_active (GiB)": 15.28, | |
| "memory/max_allocated (GiB)": 15.28, | |
| "step": 30, | |
| "tokens_per_second_per_gpu": 2704.46 | |
| }, | |
| { | |
| "epoch": 10.0, | |
| "eval_loss": 2.41866397857666, | |
| "eval_runtime": 2.5749, | |
| "eval_samples_per_second": 8.544, | |
| "eval_steps_per_second": 4.272, | |
| "memory/device_reserved (GiB)": 16.52, | |
| "memory/max_active (GiB)": 12.13, | |
| "memory/max_allocated (GiB)": 12.13, | |
| "step": 30 | |
| }, | |
| { | |
| "epoch": 11.88888888888889, | |
| "grad_norm": 3.0285682678222656, | |
| "learning_rate": 1.9098300562505266e-06, | |
| "loss": 2.0616, | |
| "memory/device_reserved (GiB)": 16.52, | |
| "memory/max_active (GiB)": 15.28, | |
| "memory/max_allocated (GiB)": 15.28, | |
| "step": 35, | |
| "tokens_per_second_per_gpu": 575.33 | |
| }, | |
| { | |
| "epoch": 11.88888888888889, | |
| "eval_loss": 2.40836238861084, | |
| "eval_runtime": 2.5669, | |
| "eval_samples_per_second": 8.571, | |
| "eval_steps_per_second": 4.285, | |
| "memory/device_reserved (GiB)": 16.52, | |
| "memory/max_active (GiB)": 12.13, | |
| "memory/max_allocated (GiB)": 12.13, | |
| "step": 35 | |
| }, | |
| { | |
| "epoch": 13.444444444444445, | |
| "grad_norm": 3.364469528198242, | |
| "learning_rate": 5.4781046317267103e-08, | |
| "loss": 2.0263, | |
| "memory/device_reserved (GiB)": 16.52, | |
| "memory/max_active (GiB)": 15.28, | |
| "memory/max_allocated (GiB)": 15.28, | |
| "step": 40, | |
| "tokens_per_second_per_gpu": 447.5 | |
| }, | |
| { | |
| "epoch": 13.444444444444445, | |
| "eval_loss": 2.39176344871521, | |
| "eval_runtime": 2.5947, | |
| "eval_samples_per_second": 8.479, | |
| "eval_steps_per_second": 4.239, | |
| "memory/device_reserved (GiB)": 16.52, | |
| "memory/max_active (GiB)": 12.13, | |
| "memory/max_allocated (GiB)": 12.13, | |
| "step": 40 | |
| } | |
| ], | |
| "logging_steps": 5, | |
| "max_steps": 40, | |
| "num_input_tokens_seen": 0, | |
| "num_train_epochs": 14, | |
| "save_steps": 100, | |
| "stateful_callbacks": { | |
| "EarlyStoppingCallback": { | |
| "args": { | |
| "early_stopping_patience": 2, | |
| "early_stopping_threshold": 0.0 | |
| }, | |
| "attributes": { | |
| "early_stopping_patience_counter": 0 | |
| } | |
| }, | |
| "TrainerControl": { | |
| "args": { | |
| "should_epoch_stop": false, | |
| "should_evaluate": false, | |
| "should_log": false, | |
| "should_save": true, | |
| "should_training_stop": true | |
| }, | |
| "attributes": {} | |
| } | |
| }, | |
| "total_flos": 2.301236913949901e+16, | |
| "train_batch_size": 2, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |