Text Generation
Transformers
Safetensors
mistral
llama-factory
full
Generated from Trainer
conversational
text-generation-inference
Instructions to use sedrickkeh/sft with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sedrickkeh/sft with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sedrickkeh/sft") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("sedrickkeh/sft") model = AutoModelForCausalLM.from_pretrained("sedrickkeh/sft") 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 sedrickkeh/sft with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sedrickkeh/sft" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sedrickkeh/sft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/sedrickkeh/sft
- SGLang
How to use sedrickkeh/sft 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 "sedrickkeh/sft" \ --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": "sedrickkeh/sft", "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 "sedrickkeh/sft" \ --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": "sedrickkeh/sft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use sedrickkeh/sft with Docker Model Runner:
docker model run hf.co/sedrickkeh/sft
| { | |
| "best_metric": null, | |
| "best_model_checkpoint": null, | |
| "epoch": 1.0, | |
| "eval_steps": 500, | |
| "global_step": 23, | |
| "is_hyper_param_search": false, | |
| "is_local_process_zero": true, | |
| "is_world_process_zero": true, | |
| "log_history": [ | |
| { | |
| "epoch": 0.43478260869565216, | |
| "grad_norm": 7.840970039367676, | |
| "learning_rate": 1.4539904997395468e-05, | |
| "loss": 1.3694, | |
| "step": 10 | |
| }, | |
| { | |
| "epoch": 0.8695652173913043, | |
| "grad_norm": 2.1000635623931885, | |
| "learning_rate": 1.0899347581163222e-06, | |
| "loss": 1.1062, | |
| "step": 20 | |
| }, | |
| { | |
| "epoch": 1.0, | |
| "eval_loss": 1.0602577924728394, | |
| "eval_runtime": 3.2349, | |
| "eval_samples_per_second": 190.731, | |
| "eval_steps_per_second": 3.091, | |
| "step": 23 | |
| }, | |
| { | |
| "epoch": 1.0, | |
| "step": 23, | |
| "total_flos": 2.572343380583383e+17, | |
| "train_loss": 1.2197923452957817, | |
| "train_runtime": 1476.3308, | |
| "train_samples_per_second": 7.938, | |
| "train_steps_per_second": 0.016 | |
| } | |
| ], | |
| "logging_steps": 10, | |
| "max_steps": 23, | |
| "num_input_tokens_seen": 0, | |
| "num_train_epochs": 1, | |
| "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": 2.572343380583383e+17, | |
| "train_batch_size": 16, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |