Text Generation
MLX
Safetensors
English
Chinese
llama
code
math
conversational
Eval Results (legacy)
4-bit precision
Run this model with HF Jobs
Run IvanHU/YuLan-Mini-4bit on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/IvanHU/YuLan-Mini-4bit. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/IvanHU/YuLan-Mini-4bit on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/IvanHU/YuLan-Mini-4bit. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Instructions to use IvanHU/YuLan-Mini-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use IvanHU/YuLan-Mini-4bit with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("IvanHU/YuLan-Mini-4bit") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- MLX LM
How to use IvanHU/YuLan-Mini-4bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "IvanHU/YuLan-Mini-4bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "IvanHU/YuLan-Mini-4bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8080/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "IvanHU/YuLan-Mini-4bit", "messages": [ {"role": "user", "content": "Hello"} ] }' - Atomic Chat
Add files using upload-large-folder tool
Browse filesFiles changed (7)
- README.mdAdded+117
- config.jsonAdded+38
- model.safetensorsAdded+3
- model.safetensors.index.jsonAdded
- special_tokens_map.jsonAdded+30
- tokenizer.jsonAdded
- tokenizer_config.jsonAdded+85
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117---license: mitlibrary_name: mlxpipeline_tag: text-generationdatasets:- yulan-team/YuLan-Mini-Datasets- HuggingFaceFW/fineweb-edu- bigcode/the-stack-v2- mlfoundations/dclm-baseline-1.0- math-ai/AutoMathText- gair-prox/open-web-math-pro- RUC-AIBOX/long_form_thought_data_5k- internlm/Lean-Workbook- internlm/Lean-Github- deepseek-ai/DeepSeek-Prover-V1- ScalableMath/Lean-STaR-base- ScalableMath/Lean-STaR-plus- ScalableMath/Lean-CoT-base- ScalableMath/Lean-CoT-plus- opencsg/chinese-fineweb-edu- liwu/MNBVC- vikp/textbook_quality_programming- HuggingFaceTB/smollm-corpus- OpenCoder-LLM/opc-annealing-corpus- OpenCoder-LLM/opc-sft-stage1- OpenCoder-LLM/opc-sft-stage2- XinyaoHu/AMPS_mathematica- deepmind/math_dataset- mrfakename/basic-math-10m- microsoft/orca-math-word-problems-200k- AI-MO/NuminaMath-CoT- HuggingFaceTB/cosmopedia- MU-NLPC/Calc-ape210k- manu/project_gutenberg- storytracer/LoC-PD-Books- allenai/dolmalanguage:- en- zhtags:- code- math- mlxarxiv: 2412.17743base_model: yulan-team/YuLan-Minimodel-index:- name: YuLan-Mini results: - task: type: text-generation dataset: name: HumanEval type: openai_humaneval metrics: - type: pass@1 value: 0.64 name: pass@1 verified: false - task: type: text-generation dataset: name: MBPP type: mbpp metrics: - type: pass@1 value: 0.659 name: pass@1 verified: false - task: type: text-generation dataset: name: MATH-500 type: math-500 metrics: - type: maj@1 value: 0.378 name: maj@1 verified: false - task: type: text-generation dataset: name: GSM8K type: gsm8k metrics: - type: maj@1 value: 0.684 name: maj@1 verified: false---
# IvanHU/YuLan-Mini-4bit
This model [IvanHU/YuLan-Mini-4bit](https://huggingface.co/IvanHU/YuLan-Mini-4bit) wasconverted to MLX format from [yulan-team/YuLan-Mini](https://huggingface.co/yulan-team/YuLan-Mini)using mlx-lm version **0.22.2**.
## Use with mlx
```bashpip install mlx-lm```
```pythonfrom mlx_lm import load, generate
model, tokenizer = load("IvanHU/YuLan-Mini-4bit")
prompt = "hello"
if tokenizer.chat_template is not None: messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True )
response = generate(model, tokenizer, prompt=prompt, verbose=True)```1234567891011121314151617181920212223242526272829303132333435363738{ "architectures": [ "LlamaForCausalLM" ], "attention_bias": true, "attention_dropout": 0.0, "bos_token_id": 1, "eos_token_id": 2, "head_dim": 64, "hidden_act": "silu", "hidden_size": 1920, "initializer_range": 5e-05, "intermediate_size": 4800, "max_position_embeddings": 28723, "mlp_bias": false, "model_type": "llama", "num_attention_heads": 30, "num_hidden_layers": 56, "num_key_value_heads": 6, "pad_token_id": 102, "pretraining_tp": 1, "quantization": { "group_size": 64, "bits": 4 }, "quantization_config": { "group_size": 64, "bits": 4 }, "rms_norm_eps": 1e-06, "rope_scaling": null, "rope_theta": 490000.0, "tie_word_embeddings": false, "torch_dtype": "bfloat16", "transformers_version": "4.47.1", "use_cache": true, "vocab_size": 99000}123version https://git-lfs.github.com/spec/v1oid sha256:e0bf202235f04f9dc4f474f026d73f3e47c5d597023ca624f481f4252c9715eesize 1364562335123456789101112131415161718192021222324252627282930{ "bos_token": { "content": "<s>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }, "eos_token": { "content": "</s>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }, "pad_token": { "content": "<pad>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }, "unk_token": { "content": "<unk>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }}12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485{ "add_bos_token": true, "add_eos_token": false, "add_prefix_space": null, "added_tokens_decoder": { "0": { "content": "<unk>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "1": { "content": "<s>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "2": { "content": "</s>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "102": { "content": "<pad>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "103": { "content": "<reasoning_step>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "104": { "content": "<|start_header_id|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "105": { "content": "<|end_header_id|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "106": { "content": "<|eot_id|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true } }, "bos_token": "<s>", "chat_template": "{% if messages[0]['role'] == 'system' %}\n {% set offset = 1 %}\n{% else %}\n {% set offset = 0 %}\n{% endif %}\n\n{{ bos_token }}\n{% for message in messages %}\n {% if (message['role'] == 'user') != (loop.index0 % 2 == offset) %}\n {{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}\n {% endif %}\n\n {{ '<|start_header_id|>' + message['role'] + '<|end_header_id|>\n\n' + message['content'] | trim + '<|eot_id|>' }}\n{% endfor %}\n\n{% if add_generation_prompt %}\n {{ '<|start_header_id|>' + 'assistant' + '<|end_header_id|>\n\n' }}\n{% endif %}", "clean_up_tokenization_spaces": false, "eos_token": "</s>", "extra_special_tokens": {}, "legacy": true, "model_max_length": 1000000000000000019884624838656, "pad_token": "<pad>", "padding_side": "right", "sp_model_kwargs": {}, "spaces_between_special_tokens": false, "tokenizer_class": "LlamaTokenizerFast", "unk_token": "<unk>", "use_default_system_prompt": false}README.mdAdded+117
config.jsonAdded+38
model.safetensorsAdded+3
model.safetensors.index.jsonAdded
special_tokens_map.jsonAdded+30
tokenizer.jsonAdded
tokenizer_config.jsonAdded+85