Instructions to use weihao1/MuMath-Code-CL-70B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use weihao1/MuMath-Code-CL-70B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="weihao1/MuMath-Code-CL-70B")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("weihao1/MuMath-Code-CL-70B") model = AutoModelForCausalLM.from_pretrained("weihao1/MuMath-Code-CL-70B", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use weihao1/MuMath-Code-CL-70B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "weihao1/MuMath-Code-CL-70B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "weihao1/MuMath-Code-CL-70B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/weihao1/MuMath-Code-CL-70B
- SGLang
How to use weihao1/MuMath-Code-CL-70B 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 "weihao1/MuMath-Code-CL-70B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "weihao1/MuMath-Code-CL-70B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "weihao1/MuMath-Code-CL-70B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "weihao1/MuMath-Code-CL-70B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use weihao1/MuMath-Code-CL-70B with Docker Model Runner:
docker model run hf.co/weihao1/MuMath-Code-CL-70B
File size: 1,366 Bytes
c7f695c 1bfdfe7 c7f695c | 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 | {
"num_layers": 80,
"hidden_size": 8192,
"ffn_hidden_size": 28672,
"layernorm_epsilon": 1e-05,
"max_sequence_length": 2048,
"num_attention_heads": 64,
"num_key_value_heads": 8,
"max_position_embeddings": 4096,
"vocab_size": 32016,
"rope_scaling": null,
"rope_theta": 10000,
"transpose_mlp_dense": true,
"transpose_query_key_value": true,
"load_platform": "megatron",
"save_platform": "huggingface",
"load_ckpt_path": "mumath_code_stage_2_pot_new_config_0310/iter_0025128",
"save_ckpt_path": "mumath_code_stage_2_pot_new_config_0310/iter_0025128_hf",
"common_config_path": "config/llama-2-70b_codellama.json",
"tensor_model_parallel_size": 1,
"pipeline_model_parallel_size": 1,
"data_parallel_size": 1,
"no_load_optim": true,
"no_save_optim": false,
"use_distributed_optimizer": true,
"megatron_path": "/workspace/Megatron-LM/",
"_name_or_path": "codellama/CodeLlama-70b-Python-hf",
"architectures": [
"LlamaForCausalLM"
],
"bos_token_id": 1,
"eos_token_id": 2,
"hidden_act": "silu",
"intermediate_size": 28672,
"initializer_range": 0.02,
"model_type": "llama",
"num_hidden_layers": 80,
"pad_token_id": 0,
"rms_norm_eps": 1e-05,
"tie_word_embeddings": false,
"pretraining_tp": 1,
"use_cache": true
} |