Instructions to use TPreview/GaMS3-12B-Lex2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use TPreview/GaMS3-12B-Lex2 with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("cjvt/GaMS3-12B") model = PeftModel.from_pretrained(base_model, "TPreview/GaMS3-12B-Lex2") - Transformers
How to use TPreview/GaMS3-12B-Lex2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="TPreview/GaMS3-12B-Lex2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("TPreview/GaMS3-12B-Lex2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use TPreview/GaMS3-12B-Lex2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TPreview/GaMS3-12B-Lex2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TPreview/GaMS3-12B-Lex2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/TPreview/GaMS3-12B-Lex2
- SGLang
How to use TPreview/GaMS3-12B-Lex2 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 "TPreview/GaMS3-12B-Lex2" \ --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": "TPreview/GaMS3-12B-Lex2", "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 "TPreview/GaMS3-12B-Lex2" \ --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": "TPreview/GaMS3-12B-Lex2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use TPreview/GaMS3-12B-Lex2 with Docker Model Runner:
docker model run hf.co/TPreview/GaMS3-12B-Lex2
Download trainer_state.json from TPreview/GaMS3-12B-Lex2: direct link, hf CLI and curl.
- Browser
- Download file 6.1 kB
-
https://huggingface.co/TPreview/GaMS3-12B-Lex2/resolve/main/trainer_state.json
- Command line
-
hf download hf://TPreview/GaMS3-12B-Lex2/trainer_state.json
-
curl -L -o trainer_state.json https://huggingface.co/TPreview/GaMS3-12B-Lex2/resolve/main/trainer_state.json
6.1 kB
| { | |
| "best_global_step": null, | |
| "best_metric": null, | |
| "best_model_checkpoint": null, | |
| "epoch": 1.0, | |
| "eval_steps": 25, | |
| "global_step": 115, | |
| "is_hyper_param_search": false, | |
| "is_local_process_zero": true, | |
| "is_world_process_zero": true, | |
| "log_history": [ | |
| { | |
| "epoch": 0.04381161007667032, | |
| "grad_norm": 0.6445760726928711, | |
| "learning_rate": 3.3333333333333335e-05, | |
| "loss": 0.44997148513793944, | |
| "step": 5 | |
| }, | |
| { | |
| "epoch": 0.08762322015334063, | |
| "grad_norm": 0.2040737122297287, | |
| "learning_rate": 7.500000000000001e-05, | |
| "loss": 0.253184175491333, | |
| "step": 10 | |
| }, | |
| { | |
| "epoch": 0.13143483023001096, | |
| "grad_norm": 0.11370108276605606, | |
| "learning_rate": 9.990699835799469e-05, | |
| "loss": 0.1890493392944336, | |
| "step": 15 | |
| }, | |
| { | |
| "epoch": 0.17524644030668127, | |
| "grad_norm": 0.0560263991355896, | |
| "learning_rate": 9.886469909625625e-05, | |
| "loss": 0.16157859563827515, | |
| "step": 20 | |
| }, | |
| { | |
| "epoch": 0.21905805038335158, | |
| "grad_norm": 0.05086812004446983, | |
| "learning_rate": 9.668812408047679e-05, | |
| "loss": 0.14776169061660765, | |
| "step": 25 | |
| }, | |
| { | |
| "epoch": 0.21905805038335158, | |
| "eval_loss": 0.15636882185935974, | |
| "eval_runtime": 2.7445, | |
| "eval_samples_per_second": 13.481, | |
| "eval_steps_per_second": 3.644, | |
| "step": 25 | |
| }, | |
| { | |
| "epoch": 0.2628696604600219, | |
| "grad_norm": 0.4398188889026642, | |
| "learning_rate": 9.342779723309745e-05, | |
| "loss": 0.13989536762237548, | |
| "step": 30 | |
| }, | |
| { | |
| "epoch": 0.3066812705366922, | |
| "grad_norm": 0.03143283724784851, | |
| "learning_rate": 8.915939915302968e-05, | |
| "loss": 0.13840868473052978, | |
| "step": 35 | |
| }, | |
| { | |
| "epoch": 0.35049288061336253, | |
| "grad_norm": 0.030261408537626266, | |
| "learning_rate": 8.398201037367201e-05, | |
| "loss": 0.13194940090179444, | |
| "step": 40 | |
| }, | |
| { | |
| "epoch": 0.39430449069003287, | |
| "grad_norm": 0.027745651081204414, | |
| "learning_rate": 7.801581144806752e-05, | |
| "loss": 0.1258658289909363, | |
| "step": 45 | |
| }, | |
| { | |
| "epoch": 0.43811610076670315, | |
| "grad_norm": 0.028578005731105804, | |
| "learning_rate": 7.139929324815965e-05, | |
| "loss": 0.1307690382003784, | |
| "step": 50 | |
| }, | |
| { | |
| "epoch": 0.43811610076670315, | |
| "eval_loss": 0.13964250683784485, | |
| "eval_runtime": 2.7343, | |
| "eval_samples_per_second": 13.532, | |
| "eval_steps_per_second": 3.657, | |
| "step": 50 | |
| }, | |
| { | |
| "epoch": 0.4819277108433735, | |
| "grad_norm": 0.02204604260623455, | |
| "learning_rate": 6.42860422342998e-05, | |
| "loss": 0.11970643997192383, | |
| "step": 55 | |
| }, | |
| { | |
| "epoch": 0.5257393209200438, | |
| "grad_norm": 0.01909324899315834, | |
| "learning_rate": 5.6841175317195515e-05, | |
| "loss": 0.12441145181655884, | |
| "step": 60 | |
| }, | |
| { | |
| "epoch": 0.5695509309967142, | |
| "grad_norm": 0.02801951766014099, | |
| "learning_rate": 4.923750706835371e-05, | |
| "loss": 0.11856402158737182, | |
| "step": 65 | |
| }, | |
| { | |
| "epoch": 0.6133625410733844, | |
| "grad_norm": 0.02440124936401844, | |
| "learning_rate": 4.16515382479539e-05, | |
| "loss": 0.12577390670776367, | |
| "step": 70 | |
| }, | |
| { | |
| "epoch": 0.6571741511500547, | |
| "grad_norm": 0.03482368588447571, | |
| "learning_rate": 3.4259358766770766e-05, | |
| "loss": 0.12301583290100097, | |
| "step": 75 | |
| }, | |
| { | |
| "epoch": 0.6571741511500547, | |
| "eval_loss": 0.13510531187057495, | |
| "eval_runtime": 2.7462, | |
| "eval_samples_per_second": 13.473, | |
| "eval_steps_per_second": 3.641, | |
| "step": 75 | |
| }, | |
| { | |
| "epoch": 0.7009857612267251, | |
| "grad_norm": 0.03209087997674942, | |
| "learning_rate": 2.7232560184971434e-05, | |
| "loss": 0.11824085712432861, | |
| "step": 80 | |
| }, | |
| { | |
| "epoch": 0.7447973713033954, | |
| "grad_norm": 0.027280066162347794, | |
| "learning_rate": 2.0734252629237894e-05, | |
| "loss": 0.1161639928817749, | |
| "step": 85 | |
| }, | |
| { | |
| "epoch": 0.7886089813800657, | |
| "grad_norm": 0.024801179766654968, | |
| "learning_rate": 1.491527858584535e-05, | |
| "loss": 0.1195792555809021, | |
| "step": 90 | |
| }, | |
| { | |
| "epoch": 0.8324205914567361, | |
| "grad_norm": 0.023875568062067032, | |
| "learning_rate": 9.91071145732948e-06, | |
| "loss": 0.11831022500991821, | |
| "step": 95 | |
| }, | |
| { | |
| "epoch": 0.8762322015334063, | |
| "grad_norm": 0.02501710318028927, | |
| "learning_rate": 5.83672016027697e-06, | |
| "loss": 0.11868228912353515, | |
| "step": 100 | |
| }, | |
| { | |
| "epoch": 0.8762322015334063, | |
| "eval_loss": 0.1338396519422531, | |
| "eval_runtime": 2.7535, | |
| "eval_samples_per_second": 13.437, | |
| "eval_steps_per_second": 3.632, | |
| "step": 100 | |
| }, | |
| { | |
| "epoch": 0.9200438116100766, | |
| "grad_norm": 0.02370544523000717, | |
| "learning_rate": 2.787872545015069e-06, | |
| "loss": 0.1251981019973755, | |
| "step": 105 | |
| }, | |
| { | |
| "epoch": 0.963855421686747, | |
| "grad_norm": 0.01968785747885704, | |
| "learning_rate": 8.349402317873789e-07, | |
| "loss": 0.11879189014434814, | |
| "step": 110 | |
| }, | |
| { | |
| "epoch": 1.0, | |
| "grad_norm": 0.05922802537679672, | |
| "learning_rate": 2.3255818832423894e-08, | |
| "loss": 0.12383102178573609, | |
| "step": 115 | |
| }, | |
| { | |
| "epoch": 1.0, | |
| "eval_loss": 0.1337558627128601, | |
| "eval_runtime": 2.7386, | |
| "eval_samples_per_second": 13.511, | |
| "eval_steps_per_second": 3.652, | |
| "step": 115 | |
| } | |
| ], | |
| "logging_steps": 5, | |
| "max_steps": 115, | |
| "num_input_tokens_seen": 0, | |
| "num_train_epochs": 1, | |
| "save_steps": 25, | |
| "stateful_callbacks": { | |
| "TrainerControl": { | |
| "args": { | |
| "should_epoch_stop": false, | |
| "should_evaluate": false, | |
| "should_log": false, | |
| "should_save": true, | |
| "should_training_stop": true | |
| }, | |
| "attributes": {} | |
| } | |
| }, | |
| "total_flos": 8.099298143947981e+18, | |
| "train_batch_size": 1, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |