Run this model with HF Jobs
Run zgcagi/Recurloop-400M 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/zgcagi/Recurloop-400M. 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/zgcagi/Recurloop-400M 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/zgcagi/Recurloop-400M. 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/zgcagi/Recurloop-400M. 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 zgcagi/Recurloop-400M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use zgcagi/Recurloop-400M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="zgcagi/Recurloop-400M", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("zgcagi/Recurloop-400M", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use zgcagi/Recurloop-400M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "zgcagi/Recurloop-400M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "zgcagi/Recurloop-400M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/zgcagi/Recurloop-400M
- SGLang
How to use zgcagi/Recurloop-400M 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 "zgcagi/Recurloop-400M" \ --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": "zgcagi/Recurloop-400M", "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 "zgcagi/Recurloop-400M" \ --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": "zgcagi/Recurloop-400M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use zgcagi/Recurloop-400M with Docker Model Runner:
docker model run hf.co/zgcagi/Recurloop-400M
Rename model_type/config/modeling modules from ult to recurloop (RecurloopConfig, RecurloopForCausalLM)
Browse filesFiles changed (4)
32 unmodified lines33343536373839404142434432 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -textassets/ult-architecture.png filter=lfs diff=lfs merge=lfs -textassets/ult-results.png filter=lfs diff=lfs merge=lfs -textassets/ult-training-decoding.png filter=lfs diff=lfs merge=lfs -textassets/dlt-results.png filter=lfs diff=lfs merge=lfs -textassets/dlt-architecture.png filter=lfs diff=lfs merge=lfs -textassets/dlt-training-decoding.png filter=lfs diff=lfs merge=lfs -textassets/recurloop-architecture.png filter=lfs diff=lfs merge=lfs -textassets/recurloop-results.png filter=lfs diff=lfs merge=lfs -textassets/recurloop-training-decoding.png filter=lfs diff=lfs merge=lfs -text32 unmodified lines33343536373832 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -textassets/recurloop-architecture.png filter=lfs diff=lfs merge=lfs -textassets/recurloop-results.png filter=lfs diff=lfs merge=lfs -textassets/recurloop-training-decoding.png filter=lfs diff=lfs merge=lfs -text
12345678910116 unmodified lines18192021{"model_type": "ult","architectures": ["ULTForCausalLM"],"auto_map": {"AutoConfig": "configuration_ult.ULTConfig","AutoModelForCausalLM": "modeling_ult.ULTForCausalLM"},"hidden_size": 1536,"stage_depth": 4,6 unmodified lines"bos_token_id": 0,"eos_token_id": 1,"pad_token_id": 2}12345678910116 unmodified lines18192021{"model_type": "recurloop","architectures": ["RecurloopForCausalLM"],"auto_map": {"AutoConfig": "configuration_recurloop.RecurloopConfig","AutoModelForCausalLM": "modeling_recurloop.RecurloopForCausalLM"},"hidden_size": 1536,"stage_depth": 4,6 unmodified lines"bos_token_id": 0,"eos_token_id": 1,"pad_token_id": 2}
12345678from transformers import PretrainedConfigclass ULTConfig(PretrainedConfig):model_type = "ult"def __init__(self, hidden_size=1024, stage_depth=2, max_position_embeddings=2048,vocab_size=32768, core_iterations=8, passes=2, norm_eps=1e-5, **kwargs):12345678from transformers import PretrainedConfigclass RecurloopConfig(PretrainedConfig):model_type = "recurloop"def __init__(self, hidden_size=1024, stage_depth=2, max_position_embeddings=2048,vocab_size=32768, core_iterations=8, passes=2, norm_eps=1e-5, **kwargs):
6 unmodified lines78910111213110 unmodified lines1241251261271281291301316 unmodified linesfrom torch.nn import functional as Ffrom transformers import GenerationMixin, PreTrainedModelfrom transformers.modeling_outputs import CausalLMOutputfrom .configuration_ult import ULTConfigclass RMSNorm(nn.Module):110 unmodified linesreturn nn.init.trunc_normal_(state, std=std, a=-3*std, b=3*std)class ULTForCausalLM(PreTrainedModel, GenerationMixin):config_class = ULTConfigbase_model_prefix = "base"_tied_weights_keys = ["base.lm_head.weight"]6 unmodified lines78910111213110 unmodified lines1241251261271281291301316 unmodified linesfrom torch.nn import functional as Ffrom transformers import GenerationMixin, PreTrainedModelfrom transformers.modeling_outputs import CausalLMOutputfrom .configuration_recurloop import RecurloopConfigclass RMSNorm(nn.Module):110 unmodified linesreturn nn.init.trunc_normal_(state, std=std, a=-3*std, b=3*std)class RecurloopForCausalLM(PreTrainedModel, GenerationMixin):config_class = RecurloopConfigbase_model_prefix = "base"_tied_weights_keys = ["base.lm_head.weight"]
.gitattributes-6
config.json+5-5
configuration_ult.py → configuration_recurloop.pyRenamed+2-2
modeling_ult.py → modeling_recurloop.pyRenamed+3-3