Text Generation
Transformers
Safetensors
English
pruned_flex_olmo
custom_code
math
pruned
distilled
mixture-of-experts
Instructions to use hbfreed/flex-math-8192 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hbfreed/flex-math-8192 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="hbfreed/flex-math-8192", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("hbfreed/flex-math-8192", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use hbfreed/flex-math-8192 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "hbfreed/flex-math-8192" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "hbfreed/flex-math-8192", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/hbfreed/flex-math-8192
- SGLang
How to use hbfreed/flex-math-8192 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 "hbfreed/flex-math-8192" \ --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": "hbfreed/flex-math-8192", "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 "hbfreed/flex-math-8192" \ --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": "hbfreed/flex-math-8192", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use hbfreed/flex-math-8192 with Docker Model Runner:
docker model run hf.co/hbfreed/flex-math-8192
Upload config.json with huggingface_hub
Browse files- config.json +96 -0
config.json
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"return_dict": true,
|
| 3 |
+
"output_hidden_states": false,
|
| 4 |
+
"torchscript": false,
|
| 5 |
+
"dtype": "float32",
|
| 6 |
+
"pruned_heads": {},
|
| 7 |
+
"tie_word_embeddings": false,
|
| 8 |
+
"chunk_size_feed_forward": 0,
|
| 9 |
+
"is_encoder_decoder": false,
|
| 10 |
+
"is_decoder": false,
|
| 11 |
+
"cross_attention_hidden_size": null,
|
| 12 |
+
"add_cross_attention": false,
|
| 13 |
+
"tie_encoder_decoder": false,
|
| 14 |
+
"architectures": [
|
| 15 |
+
"FlexOlmoForCausalLM"
|
| 16 |
+
],
|
| 17 |
+
"finetuning_task": null,
|
| 18 |
+
"id2label": {
|
| 19 |
+
"0": "LABEL_0",
|
| 20 |
+
"1": "LABEL_1"
|
| 21 |
+
},
|
| 22 |
+
"label2id": {
|
| 23 |
+
"LABEL_0": 0,
|
| 24 |
+
"LABEL_1": 1
|
| 25 |
+
},
|
| 26 |
+
"task_specific_params": null,
|
| 27 |
+
"problem_type": null,
|
| 28 |
+
"tokenizer_class": null,
|
| 29 |
+
"prefix": null,
|
| 30 |
+
"bos_token_id": null,
|
| 31 |
+
"pad_token_id": 100277,
|
| 32 |
+
"eos_token_id": 100257,
|
| 33 |
+
"sep_token_id": null,
|
| 34 |
+
"decoder_start_token_id": null,
|
| 35 |
+
"max_length": 20,
|
| 36 |
+
"min_length": 0,
|
| 37 |
+
"do_sample": false,
|
| 38 |
+
"early_stopping": false,
|
| 39 |
+
"num_beams": 1,
|
| 40 |
+
"temperature": 1.0,
|
| 41 |
+
"top_k": 50,
|
| 42 |
+
"top_p": 1.0,
|
| 43 |
+
"typical_p": 1.0,
|
| 44 |
+
"repetition_penalty": 1.0,
|
| 45 |
+
"length_penalty": 1.0,
|
| 46 |
+
"no_repeat_ngram_size": 0,
|
| 47 |
+
"encoder_no_repeat_ngram_size": 0,
|
| 48 |
+
"bad_words_ids": null,
|
| 49 |
+
"num_return_sequences": 1,
|
| 50 |
+
"output_scores": false,
|
| 51 |
+
"return_dict_in_generate": false,
|
| 52 |
+
"forced_bos_token_id": null,
|
| 53 |
+
"forced_eos_token_id": null,
|
| 54 |
+
"remove_invalid_values": false,
|
| 55 |
+
"exponential_decay_length_penalty": null,
|
| 56 |
+
"suppress_tokens": null,
|
| 57 |
+
"begin_suppress_tokens": null,
|
| 58 |
+
"num_beam_groups": 1,
|
| 59 |
+
"diversity_penalty": 0.0,
|
| 60 |
+
"_name_or_path": "allenai/Flex-math-2x7B-1T",
|
| 61 |
+
"transformers_version": "4.57.6",
|
| 62 |
+
"clip_qkv": null,
|
| 63 |
+
"model_type": "pruned_flex_olmo",
|
| 64 |
+
"tf_legacy_loss": false,
|
| 65 |
+
"use_bfloat16": false,
|
| 66 |
+
"vocab_size": 100352,
|
| 67 |
+
"max_position_embeddings": 4096,
|
| 68 |
+
"hidden_size": 4096,
|
| 69 |
+
"intermediate_size": 11008,
|
| 70 |
+
"num_hidden_layers": 32,
|
| 71 |
+
"num_attention_heads": 32,
|
| 72 |
+
"num_key_value_heads": 32,
|
| 73 |
+
"hidden_act": "silu",
|
| 74 |
+
"initializer_range": 0.02,
|
| 75 |
+
"rms_norm_eps": 1e-06,
|
| 76 |
+
"use_cache": true,
|
| 77 |
+
"rope_theta": 500000,
|
| 78 |
+
"rope_scaling": null,
|
| 79 |
+
"attention_bias": false,
|
| 80 |
+
"attention_dropout": 0.0,
|
| 81 |
+
"num_experts_per_tok": 2,
|
| 82 |
+
"num_experts": 2,
|
| 83 |
+
"output_router_logits": false,
|
| 84 |
+
"router_aux_loss_coef": 0.01,
|
| 85 |
+
"norm_topk_prob": false,
|
| 86 |
+
"output_attentions": false,
|
| 87 |
+
"expert_1_intermediate_size": 8192,
|
| 88 |
+
"auto_map": {
|
| 89 |
+
"AutoConfig": "configuration_pruned_flex_olmo.PrunedFlexOlmoConfig",
|
| 90 |
+
"AutoModelForCausalLM": "modeling_pruned_flex_olmo.PrunedFlexOlmoForCausalLM"
|
| 91 |
+
},
|
| 92 |
+
"_pruning_metadata": {
|
| 93 |
+
"base_model": "allenai/Flex-math-2x7B-1T",
|
| 94 |
+
"importance_type": "math"
|
| 95 |
+
}
|
| 96 |
+
}
|