Text Generation
Transformers
Safetensors
glm4
cooking
recipes
dpo
provenance
abstention
conversational
Instructions to use HumanjavaEnterprises/GLM-4-9B-Cooking-Assistant with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HumanjavaEnterprises/GLM-4-9B-Cooking-Assistant with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="HumanjavaEnterprises/GLM-4-9B-Cooking-Assistant") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("HumanjavaEnterprises/GLM-4-9B-Cooking-Assistant") model = AutoModelForCausalLM.from_pretrained("HumanjavaEnterprises/GLM-4-9B-Cooking-Assistant", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use HumanjavaEnterprises/GLM-4-9B-Cooking-Assistant with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "HumanjavaEnterprises/GLM-4-9B-Cooking-Assistant" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HumanjavaEnterprises/GLM-4-9B-Cooking-Assistant", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/HumanjavaEnterprises/GLM-4-9B-Cooking-Assistant
- SGLang
How to use HumanjavaEnterprises/GLM-4-9B-Cooking-Assistant 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 "HumanjavaEnterprises/GLM-4-9B-Cooking-Assistant" \ --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": "HumanjavaEnterprises/GLM-4-9B-Cooking-Assistant", "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 "HumanjavaEnterprises/GLM-4-9B-Cooking-Assistant" \ --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": "HumanjavaEnterprises/GLM-4-9B-Cooking-Assistant", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use HumanjavaEnterprises/GLM-4-9B-Cooking-Assistant with Docker Model Runner:
docker model run hf.co/HumanjavaEnterprises/GLM-4-9B-Cooking-Assistant
Download SHA256SUMS from HumanjavaEnterprises/GLM-4-9B-Cooking-Assistant: direct link, hf CLI and curl.
- Browser
- Download file 1.08 kB
-
https://huggingface.co/HumanjavaEnterprises/GLM-4-9B-Cooking-Assistant/resolve/main/SHA256SUMS
- Command line
-
hf download hf://HumanjavaEnterprises/GLM-4-9B-Cooking-Assistant/SHA256SUMS
-
curl -L -o SHA256SUMS https://huggingface.co/HumanjavaEnterprises/GLM-4-9B-Cooking-Assistant/resolve/main/SHA256SUMS
1.08 kB
| 3f5e5b9cc04bf96620f48b48888b7b19b08ad4cdebb145cb8026a2dff46c9e81 model-00001-of-00004.safetensors | |
| 4ea6f5947e61b44619ce20bcab318890663e1a799486248499de824bbdb35b8a model-00002-of-00004.safetensors | |
| 73c2c940fcecfe74c48a7433360e7b304149901e40a11882348fa852a9402b87 model-00003-of-00004.safetensors | |
| b94a33a656e90c29e9961b40308b01faf5a7118d49560e217000982e613c729f model-00004-of-00004.safetensors | |
| 8a8f873a73f5234b9e950b016ab844ba47cb8399d8bbdba202ed0ddc3ca7d421 config.json | |
| 56ee0be8c595f22a6a80a822096533e10455fcd1e859e0fc36a6e760088147fa generation_config.json | |
| 421fb251889681bc9c3bed28e5cd079e00a789a1a04024d53c8d182a8943af34 model.safetensors.index.json | |
| 35a6dd9ff6e2474ba72b180db853851d2a84fce3d12095089285f447c7474541 special_tokens_map.json | |
| e316474d867ad1f91165a12d90c73b27a7e0f9a1c9293831cca66c792bfe9a36 tokenizer_config.json | |
| 76ebeac0d8bd7879ead7b43c16b44981f277e47225de2bd7de9ae1a6cc664a8c tokenizer.json | |
| db700f25fa300e53634c6fc78dee86b7fbd6d27e624edb855b18a4078c83a822 chat_template.jinja | |
| d08ac7b31e69ddf9845d56f2705325e69873f87b0b34b4bd53a3185428a784ae LICENSE | |