Instructions to use simonycl/GLM-4-9B-0414-InverseIFEval-DPO with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use simonycl/GLM-4-9B-0414-InverseIFEval-DPO with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="simonycl/GLM-4-9B-0414-InverseIFEval-DPO") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("simonycl/GLM-4-9B-0414-InverseIFEval-DPO") model = AutoModelForCausalLM.from_pretrained("simonycl/GLM-4-9B-0414-InverseIFEval-DPO") 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 simonycl/GLM-4-9B-0414-InverseIFEval-DPO with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "simonycl/GLM-4-9B-0414-InverseIFEval-DPO" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "simonycl/GLM-4-9B-0414-InverseIFEval-DPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/simonycl/GLM-4-9B-0414-InverseIFEval-DPO
- SGLang
How to use simonycl/GLM-4-9B-0414-InverseIFEval-DPO 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 "simonycl/GLM-4-9B-0414-InverseIFEval-DPO" \ --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": "simonycl/GLM-4-9B-0414-InverseIFEval-DPO", "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 "simonycl/GLM-4-9B-0414-InverseIFEval-DPO" \ --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": "simonycl/GLM-4-9B-0414-InverseIFEval-DPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use simonycl/GLM-4-9B-0414-InverseIFEval-DPO with Docker Model Runner:
docker model run hf.co/simonycl/GLM-4-9B-0414-InverseIFEval-DPO
File size: 1,892 Bytes
a2c9c77 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | {
"training_config": {
"dataset_name": "InverseIFEval",
"split": "train",
"print_samples": 3,
"output_dir": "checkpoints/THUDM_GLM-4-9B-0414-InverseIFEval-DPO",
"output_prefix": "ext",
"preprocessing": {
"truncate_length": 131072
},
"method": "dpo",
"abductive": false,
"gpt": {
"api_key": "OPENAI_API_KEY",
"model": "gpt-5",
"temperature": 0.7,
"max_tokens": 512
},
"model_name_or_path": "THUDM/GLM-4-9B-0414",
"beta": 0.05,
"max_length": 8192,
"max_prompt_length": 2048,
"gradient_checkpointing": true,
"gradient_checkpointing_kwargs": {
"use_reentrant": false
},
"truncation_model": "keep_end",
"per_device_train_batch_size": 1,
"per_device_eval_batch_size": 1,
"num_train_epochs": 10,
"learning_rate": 5e-07,
"weight_decay": 0.0,
"gradient_accumulation_steps": 16,
"max_grad_norm": 1.0,
"lr_scheduler_type": "constant_with_warmup",
"warmup_ratio": 0.1,
"logging_steps": 1,
"eval_steps": 50,
"eval_delay": 0,
"eval_accumulation_steps": 1,
"save_strategy": "epoch",
"save_total_limit": 10,
"save_only_model": true,
"seed": 42,
"do_eval": false,
"dataloader_num_workers": 0,
"dataloader_pin_memory": false,
"remove_unused_columns": false,
"prediction_loss_only": false,
"disable_tqdm": false,
"log_level": "info",
"optimizer": {
"type": "adam",
"lr": 5e-07,
"weight_decay": 0.0,
"betas": [
0.9,
0.999
],
"eps": 1e-08
},
"data_file": "src/datasets/InverseIFEval_data/GLM-4-9B-0414/InverseIFEval_english_GLM-4-9B-0414_gpt-5_dpo_results.json"
},
"training_completed_at": "2026-03-25T07:16:52.568816",
"model_name": "THUDM/GLM-4-9B-0414",
"dataset_name": "InverseIFEval",
"method": "dpo",
"abductive": false
} |