Text Generation
Transformers
Safetensors
granite
Generated from Trainer
open-r1
trl
sft
conversational
Instructions to use flyingbugs/granite_star_1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use flyingbugs/granite_star_1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="flyingbugs/granite_star_1") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("flyingbugs/granite_star_1") model = AutoModelForCausalLM.from_pretrained("flyingbugs/granite_star_1", 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 flyingbugs/granite_star_1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "flyingbugs/granite_star_1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "flyingbugs/granite_star_1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/flyingbugs/granite_star_1
- SGLang
How to use flyingbugs/granite_star_1 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 "flyingbugs/granite_star_1" \ --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": "flyingbugs/granite_star_1", "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 "flyingbugs/granite_star_1" \ --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": "flyingbugs/granite_star_1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use flyingbugs/granite_star_1 with Docker Model Runner:
docker model run hf.co/flyingbugs/granite_star_1
| { | |
| "best_metric": null, | |
| "best_model_checkpoint": null, | |
| "epoch": 3.0, | |
| "eval_steps": 500, | |
| "global_step": 9, | |
| "is_hyper_param_search": false, | |
| "is_local_process_zero": true, | |
| "is_world_process_zero": true, | |
| "log_history": [ | |
| { | |
| "epoch": 0.3333333333333333, | |
| "grad_norm": 17.483246106883794, | |
| "learning_rate": 5e-05, | |
| "loss": 1.1171, | |
| "step": 1 | |
| }, | |
| { | |
| "epoch": 0.6666666666666666, | |
| "grad_norm": 16.76230573230985, | |
| "learning_rate": 4.375e-05, | |
| "loss": 1.105, | |
| "step": 2 | |
| }, | |
| { | |
| "epoch": 1.0, | |
| "grad_norm": 20.19666361790089, | |
| "learning_rate": 3.7500000000000003e-05, | |
| "loss": 1.3735, | |
| "step": 3 | |
| }, | |
| { | |
| "epoch": 1.3333333333333333, | |
| "grad_norm": 4.070878513965605, | |
| "learning_rate": 3.125e-05, | |
| "loss": 0.9698, | |
| "step": 4 | |
| }, | |
| { | |
| "epoch": 1.6666666666666665, | |
| "grad_norm": 3.8268942352667814, | |
| "learning_rate": 2.5e-05, | |
| "loss": 0.7918, | |
| "step": 5 | |
| }, | |
| { | |
| "epoch": 2.0, | |
| "grad_norm": 2.6695479402984423, | |
| "learning_rate": 1.8750000000000002e-05, | |
| "loss": 0.6996, | |
| "step": 6 | |
| }, | |
| { | |
| "epoch": 2.3333333333333335, | |
| "grad_norm": 1.737118961654641, | |
| "learning_rate": 1.25e-05, | |
| "loss": 0.5728, | |
| "step": 7 | |
| }, | |
| { | |
| "epoch": 2.6666666666666665, | |
| "grad_norm": 1.1676394567045352, | |
| "learning_rate": 6.25e-06, | |
| "loss": 0.5033, | |
| "step": 8 | |
| }, | |
| { | |
| "epoch": 3.0, | |
| "grad_norm": 0.9097109004604421, | |
| "learning_rate": 0.0, | |
| "loss": 0.4516, | |
| "step": 9 | |
| }, | |
| { | |
| "epoch": 3.0, | |
| "step": 9, | |
| "total_flos": 3560949186560.0, | |
| "train_loss": 0.84272125032213, | |
| "train_runtime": 467.2816, | |
| "train_samples_per_second": 0.308, | |
| "train_steps_per_second": 0.019 | |
| } | |
| ], | |
| "logging_steps": 1, | |
| "max_steps": 9, | |
| "num_input_tokens_seen": 0, | |
| "num_train_epochs": 3, | |
| "save_steps": 500, | |
| "stateful_callbacks": { | |
| "TrainerControl": { | |
| "args": { | |
| "should_epoch_stop": false, | |
| "should_evaluate": false, | |
| "should_log": false, | |
| "should_save": true, | |
| "should_training_stop": true | |
| }, | |
| "attributes": {} | |
| } | |
| }, | |
| "total_flos": 3560949186560.0, | |
| "train_batch_size": 1, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |