Text Generation
Transformers
Safetensors
qwen2
llama-factory
full
Generated from Trainer
conversational
text-generation-inference
Instructions to use adpretko/ml815-model4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use adpretko/ml815-model4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="adpretko/ml815-model4") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("adpretko/ml815-model4") model = AutoModelForCausalLM.from_pretrained("adpretko/ml815-model4") 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 adpretko/ml815-model4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "adpretko/ml815-model4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "adpretko/ml815-model4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/adpretko/ml815-model4
- SGLang
How to use adpretko/ml815-model4 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 "adpretko/ml815-model4" \ --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": "adpretko/ml815-model4", "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 "adpretko/ml815-model4" \ --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": "adpretko/ml815-model4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use adpretko/ml815-model4 with Docker Model Runner:
docker model run hf.co/adpretko/ml815-model4
| { | |
| "best_global_step": null, | |
| "best_metric": null, | |
| "best_model_checkpoint": null, | |
| "epoch": 1.0, | |
| "eval_steps": 500, | |
| "global_step": 309, | |
| "is_hyper_param_search": false, | |
| "is_local_process_zero": true, | |
| "is_world_process_zero": true, | |
| "log_history": [ | |
| { | |
| "epoch": 0.032362459546925564, | |
| "grad_norm": 3.925151824951172, | |
| "learning_rate": 5.806451612903226e-06, | |
| "loss": 0.5976, | |
| "step": 10 | |
| }, | |
| { | |
| "epoch": 0.06472491909385113, | |
| "grad_norm": 1.8001829385757446, | |
| "learning_rate": 1.2258064516129034e-05, | |
| "loss": 0.2217, | |
| "step": 20 | |
| }, | |
| { | |
| "epoch": 0.0970873786407767, | |
| "grad_norm": 1.0522985458374023, | |
| "learning_rate": 1.870967741935484e-05, | |
| "loss": 0.1171, | |
| "step": 30 | |
| }, | |
| { | |
| "epoch": 0.12944983818770225, | |
| "grad_norm": 0.9320526719093323, | |
| "learning_rate": 1.9959162014075553e-05, | |
| "loss": 0.0936, | |
| "step": 40 | |
| }, | |
| { | |
| "epoch": 0.16181229773462782, | |
| "grad_norm": 0.5588918924331665, | |
| "learning_rate": 1.9793829188147406e-05, | |
| "loss": 0.0784, | |
| "step": 50 | |
| }, | |
| { | |
| "epoch": 0.1941747572815534, | |
| "grad_norm": 0.6221606731414795, | |
| "learning_rate": 1.9503556665478066e-05, | |
| "loss": 0.0808, | |
| "step": 60 | |
| }, | |
| { | |
| "epoch": 0.22653721682847897, | |
| "grad_norm": 0.6030081510543823, | |
| "learning_rate": 1.9092047447238775e-05, | |
| "loss": 0.0631, | |
| "step": 70 | |
| }, | |
| { | |
| "epoch": 0.2588996763754045, | |
| "grad_norm": 0.4906967878341675, | |
| "learning_rate": 1.856455114887056e-05, | |
| "loss": 0.059, | |
| "step": 80 | |
| }, | |
| { | |
| "epoch": 0.2912621359223301, | |
| "grad_norm": 0.48633530735969543, | |
| "learning_rate": 1.792779703083777e-05, | |
| "loss": 0.0664, | |
| "step": 90 | |
| }, | |
| { | |
| "epoch": 0.32362459546925565, | |
| "grad_norm": 0.5658730864524841, | |
| "learning_rate": 1.7189908153577473e-05, | |
| "loss": 0.0591, | |
| "step": 100 | |
| }, | |
| { | |
| "epoch": 0.3559870550161812, | |
| "grad_norm": 0.49161097407341003, | |
| "learning_rate": 1.636029775176862e-05, | |
| "loss": 0.0583, | |
| "step": 110 | |
| }, | |
| { | |
| "epoch": 0.3883495145631068, | |
| "grad_norm": 0.43100836873054504, | |
| "learning_rate": 1.544954914987238e-05, | |
| "loss": 0.0569, | |
| "step": 120 | |
| }, | |
| { | |
| "epoch": 0.42071197411003236, | |
| "grad_norm": 0.535409152507782, | |
| "learning_rate": 1.4469280750858854e-05, | |
| "loss": 0.0524, | |
| "step": 130 | |
| }, | |
| { | |
| "epoch": 0.45307443365695793, | |
| "grad_norm": 0.36706674098968506, | |
| "learning_rate": 1.3431997820456592e-05, | |
| "loss": 0.0487, | |
| "step": 140 | |
| }, | |
| { | |
| "epoch": 0.4854368932038835, | |
| "grad_norm": 0.372003436088562, | |
| "learning_rate": 1.2350932957710322e-05, | |
| "loss": 0.0463, | |
| "step": 150 | |
| }, | |
| { | |
| "epoch": 0.517799352750809, | |
| "grad_norm": 0.4224512577056885, | |
| "learning_rate": 1.1239877286961123e-05, | |
| "loss": 0.0462, | |
| "step": 160 | |
| }, | |
| { | |
| "epoch": 0.5501618122977346, | |
| "grad_norm": 0.3423219323158264, | |
| "learning_rate": 1.01130045247298e-05, | |
| "loss": 0.0495, | |
| "step": 170 | |
| }, | |
| { | |
| "epoch": 0.5825242718446602, | |
| "grad_norm": 0.4340055584907532, | |
| "learning_rate": 8.98469016587892e-06, | |
| "loss": 0.0438, | |
| "step": 180 | |
| }, | |
| { | |
| "epoch": 0.6148867313915858, | |
| "grad_norm": 0.3911689519882202, | |
| "learning_rate": 7.869328095692313e-06, | |
| "loss": 0.0428, | |
| "step": 190 | |
| }, | |
| { | |
| "epoch": 0.6472491909385113, | |
| "grad_norm": 0.35788559913635254, | |
| "learning_rate": 6.781146967348283e-06, | |
| "loss": 0.043, | |
| "step": 200 | |
| }, | |
| { | |
| "epoch": 0.6796116504854369, | |
| "grad_norm": 0.32428815960884094, | |
| "learning_rate": 5.7340286872557515e-06, | |
| "loss": 0.0367, | |
| "step": 210 | |
| }, | |
| { | |
| "epoch": 0.7119741100323624, | |
| "grad_norm": 0.30212825536727905, | |
| "learning_rate": 4.7413313238324556e-06, | |
| "loss": 0.042, | |
| "step": 220 | |
| }, | |
| { | |
| "epoch": 0.7443365695792881, | |
| "grad_norm": 0.42355602979660034, | |
| "learning_rate": 3.815718698874672e-06, | |
| "loss": 0.0424, | |
| "step": 230 | |
| }, | |
| { | |
| "epoch": 0.7766990291262136, | |
| "grad_norm": 0.32943040132522583, | |
| "learning_rate": 2.9689988354181742e-06, | |
| "loss": 0.0383, | |
| "step": 240 | |
| }, | |
| { | |
| "epoch": 0.8090614886731392, | |
| "grad_norm": 0.3312787711620331, | |
| "learning_rate": 2.211973323008041e-06, | |
| "loss": 0.042, | |
| "step": 250 | |
| }, | |
| { | |
| "epoch": 0.8414239482200647, | |
| "grad_norm": 0.4195694923400879, | |
| "learning_rate": 1.5542995220217961e-06, | |
| "loss": 0.0415, | |
| "step": 260 | |
| }, | |
| { | |
| "epoch": 0.8737864077669902, | |
| "grad_norm": 0.3163975477218628, | |
| "learning_rate": 1.0043673649027519e-06, | |
| "loss": 0.0382, | |
| "step": 270 | |
| }, | |
| { | |
| "epoch": 0.9061488673139159, | |
| "grad_norm": 0.2724410891532898, | |
| "learning_rate": 5.691923259479093e-07, | |
| "loss": 0.0377, | |
| "step": 280 | |
| }, | |
| { | |
| "epoch": 0.9385113268608414, | |
| "grad_norm": 0.2783817946910858, | |
| "learning_rate": 2.5432592503288e-07, | |
| "loss": 0.0383, | |
| "step": 290 | |
| }, | |
| { | |
| "epoch": 0.970873786407767, | |
| "grad_norm": 0.4168975055217743, | |
| "learning_rate": 6.378490697611761e-08, | |
| "loss": 0.0409, | |
| "step": 300 | |
| }, | |
| { | |
| "epoch": 1.0, | |
| "step": 309, | |
| "total_flos": 3.151751154761728e+17, | |
| "train_loss": 0.07590125959282168, | |
| "train_runtime": 2287.7443, | |
| "train_samples_per_second": 4.322, | |
| "train_steps_per_second": 0.135 | |
| } | |
| ], | |
| "logging_steps": 10, | |
| "max_steps": 309, | |
| "num_input_tokens_seen": 0, | |
| "num_train_epochs": 1, | |
| "save_steps": 100, | |
| "stateful_callbacks": { | |
| "TrainerControl": { | |
| "args": { | |
| "should_epoch_stop": false, | |
| "should_evaluate": false, | |
| "should_log": false, | |
| "should_save": true, | |
| "should_training_stop": true | |
| }, | |
| "attributes": {} | |
| } | |
| }, | |
| "total_flos": 3.151751154761728e+17, | |
| "train_batch_size": 8, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |