Text Generation
Transformers
Safetensors
Chinese
English
yunmo_next
base-model
traditional-chinese
hybrid-attention
kimi-delta-attention
linear-attention
research
conversational
custom_code
Eval Results (legacy)
Run this model with HF Jobs
Run yuhuanstudio/Yunmo-Next-1B-Base 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 and TRL to fine-tune https://huggingface.co/yuhuanstudio/Yunmo-Next-1B-Base. 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/yuhuanstudio/Yunmo-Next-1B-Base 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/yuhuanstudio/Yunmo-Next-1B-Base. 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.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/yuhuanstudio/Yunmo-Next-1B-Base. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use yuhuanstudio/Yunmo-Next-1B-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yuhuanstudio/Yunmo-Next-1B-Base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="yuhuanstudio/Yunmo-Next-1B-Base", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("yuhuanstudio/Yunmo-Next-1B-Base", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use yuhuanstudio/Yunmo-Next-1B-Base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "yuhuanstudio/Yunmo-Next-1B-Base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yuhuanstudio/Yunmo-Next-1B-Base", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/yuhuanstudio/Yunmo-Next-1B-Base
- SGLang
How to use yuhuanstudio/Yunmo-Next-1B-Base 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 "yuhuanstudio/Yunmo-Next-1B-Base" \ --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": "yuhuanstudio/Yunmo-Next-1B-Base", "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 "yuhuanstudio/Yunmo-Next-1B-Base" \ --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": "yuhuanstudio/Yunmo-Next-1B-Base", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use yuhuanstudio/Yunmo-Next-1B-Base with Docker Model Runner:
docker model run hf.co/yuhuanstudio/Yunmo-Next-1B-Base
File size: 2,532 Bytes
a9698d2 | 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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | """Instance-scoped dispatch for the long-context KDA training engine."""
from __future__ import annotations
from functools import partial, wraps
from threading import RLock
from .training_engine import TrainingEngineConfig
_KDA_DISPATCH_LOCK = RLock()
def configure_kda_mixer_runtime(mixer, engine: TrainingEngineConfig):
"""Attach the configured KDA call to one mixer without global leakage.
FLA's ``KimiDeltaAttention.forward`` resolves ``chunk_kda`` from its module
global at call time. The research trainer replaced that global once per
process, which works for a one-model executable but leaks when a process holds
models with different engines. This wrapper swaps it only for this bound
forward and restores it in ``finally``; the custom autograd function owns its
backward, so the global is not needed after forward returns.
"""
if not isinstance(engine, TrainingEngineConfig):
raise TypeError("KDA runtime requires TrainingEngineConfig")
segment_size = int(engine.recurrent_segment_tokens)
metadata = {
"format": "yunmo-next-kda-training-engine-v1",
"installed": False,
"segment_size": segment_size,
"allow_packed_documents": bool(engine.recurrent_packed_documents),
"official_forward_serial_backward": bool(
engine.recurrent_official_forward_serial_backward
),
}
if segment_size == 0:
mixer._yunmo_kda_training_engine = metadata
return mixer
if not (
engine.recurrent_packed_documents
and engine.recurrent_official_forward_serial_backward
):
raise RuntimeError("invalid serial recurrent execution configuration")
import fla.layers.kda as fla_kda_layer
from .kda_serial import serial_chunk_kda
engine = partial(
serial_chunk_kda,
segment_size=segment_size,
chunk_size=64,
allow_packed_documents=True,
official_forward_serial_backward=True,
)
original_forward = mixer.forward
@wraps(original_forward)
def forward(*args, **kwargs):
with _KDA_DISPATCH_LOCK:
previous = fla_kda_layer.chunk_kda
fla_kda_layer.chunk_kda = engine
try:
return original_forward(*args, **kwargs)
finally:
fla_kda_layer.chunk_kda = previous
mixer.forward = forward
metadata = {**metadata, "installed": True, "dispatch": "instance_scoped"}
mixer._yunmo_kda_training_engine = metadata
return mixer
|