Run this model with HF Jobs

Run yujiepan/dbrx-tiny-random 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/yujiepan/dbrx-tiny-random. Ask me which dataset to train on, then push the LoRA adapter to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs and Transformers to run batch inference with https://huggingface.co/yujiepan/dbrx-tiny-random on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the predictions back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs and Lighteval to evaluate https://huggingface.co/yujiepan/dbrx-tiny-random. 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/yujiepan/dbrx-tiny-random with Transformers and bitsandbytes. 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.
How to use from
Docker Model Runner
docker model run hf.co/yujiepan/dbrx-tiny-random
Quick Links

This model is randomly initialized, using the config from databricks/dbrx-instruct but with smaller size. Note the model is in float16.

Codes:

import transformers
import torch
import os
from huggingface_hub import create_repo, upload_folder

source_model_id = 'databricks/dbrx-instruct'
save_path = '/tmp/yujiepan/dbrx-tiny-random'
repo_id = 'yujiepan/dbrx-tiny-random'

config = transformers.AutoConfig.from_pretrained(
    source_model_id, trust_remote_code=True)
config.attn_config.kv_n_heads = 2
config.d_model = 4
config.ffn_config.ffn_hidden_size = 8
config.n_heads = 4
config.n_layers = 2

model = transformers.AutoModelForCausalLM.from_config(
    config, trust_remote_code=True)
model = model.half()
model.save_pretrained(save_path)

tokenizer = transformers.AutoTokenizer.from_pretrained(
    source_model_id, trust_remote_code=True)
tokenizer.save_pretrained(save_path)

result = transformers.pipelines.pipeline(
    'text-generation',
    model=model.float(), tokenizer=tokenizer)('Hello')
print(result)

os.system(f'ls -alh {save_path}')
create_repo(repo_id, exist_ok=True)
upload_folder(repo_id=repo_id, folder_path=save_path)
Downloads last month
1,049
Safetensors
Model size
806k params
Tensor type
F16
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Collection including yujiepan/dbrx-tiny-random