Text Generation
Transformers
PyTorch
Safetensors
English
Chinese
llama
code
math
conversational
Eval Results (legacy)
text-generation-inference
Instructions to use yulan-team/YuLan-Mini-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yulan-team/YuLan-Mini-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="yulan-team/YuLan-Mini-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("yulan-team/YuLan-Mini-Instruct") model = AutoModelForCausalLM.from_pretrained("yulan-team/YuLan-Mini-Instruct") 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
- vLLM
How to use yulan-team/YuLan-Mini-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "yulan-team/YuLan-Mini-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yulan-team/YuLan-Mini-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/yulan-team/YuLan-Mini-Instruct
- SGLang
How to use yulan-team/YuLan-Mini-Instruct 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 "yulan-team/YuLan-Mini-Instruct" \ --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": "yulan-team/YuLan-Mini-Instruct", "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 "yulan-team/YuLan-Mini-Instruct" \ --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": "yulan-team/YuLan-Mini-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use yulan-team/YuLan-Mini-Instruct with Docker Model Runner:
docker model run hf.co/yulan-team/YuLan-Mini-Instruct
Update Model Card
Browse files
README.md
CHANGED
|
@@ -118,15 +118,15 @@ LLM-as-a-Judge is an effective method for evaluating data quality. Specifically,
|
|
| 118 |
##### Complexity-based selection
|
| 119 |
Besides low data quality, excessive data complexity can significantly impair learning efficacy. This phenomenon is particularly pronounced in smaller-scale language models, which demonstrate limited capacity to effectively process and internalize highly complex patterns. Consequently, we develop an approach to identify and filter training samples that exceed the model's optimal learning capacity. The complexity of each instruction is measured using the following equation:
|
| 120 |
|
| 121 |
-
|
| 122 |
\text{C}(x,y) = \lambda_1 \cdot L_{\text{length}} + \lambda_2 \cdot \text{Loss}_{\text{it}}(x, y),
|
| 123 |
-
|
| 124 |
|
| 125 |
where $\lambda_1$, $\lambda_2$ are hyperparameters, $L_{\text{length}}$ denotes the length of the instruction, and $\text{Loss}_{\text{it}}(x, y)$ is the loss calculated by the base model:
|
| 126 |
|
| 127 |
-
|
| 128 |
\text{Loss}_{\text{it}}(x,y)=\sum\limits_{i=1}^{|y|} \log P(y_i|x,y_{1:i-1}),
|
| 129 |
-
|
| 130 |
where $y_i$ represents the $i$-th token in the output $y$, and $y_{1:i-1}$ denotes the sequence up to the $i-1$ tokens.
|
| 131 |
We implemente a complexity-based stratification protocol followed by selective pruning of samples exceeding empirically determined complexity thresholds.
|
| 132 |
|
|
|
|
| 118 |
##### Complexity-based selection
|
| 119 |
Besides low data quality, excessive data complexity can significantly impair learning efficacy. This phenomenon is particularly pronounced in smaller-scale language models, which demonstrate limited capacity to effectively process and internalize highly complex patterns. Consequently, we develop an approach to identify and filter training samples that exceed the model's optimal learning capacity. The complexity of each instruction is measured using the following equation:
|
| 120 |
|
| 121 |
+
$$
|
| 122 |
\text{C}(x,y) = \lambda_1 \cdot L_{\text{length}} + \lambda_2 \cdot \text{Loss}_{\text{it}}(x, y),
|
| 123 |
+
$$
|
| 124 |
|
| 125 |
where $\lambda_1$, $\lambda_2$ are hyperparameters, $L_{\text{length}}$ denotes the length of the instruction, and $\text{Loss}_{\text{it}}(x, y)$ is the loss calculated by the base model:
|
| 126 |
|
| 127 |
+
$$
|
| 128 |
\text{Loss}_{\text{it}}(x,y)=\sum\limits_{i=1}^{|y|} \log P(y_i|x,y_{1:i-1}),
|
| 129 |
+
$$
|
| 130 |
where $y_i$ represents the $i$-th token in the output $y$, and $y_{1:i-1}$ denotes the sequence up to the $i-1$ tokens.
|
| 131 |
We implemente a complexity-based stratification protocol followed by selective pruning of samples exceeding empirically determined complexity thresholds.
|
| 132 |
|