Run this model with HF Jobs

Run georgiyozhegov/calculator-8m 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/georgiyozhegov/calculator-8m. 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/georgiyozhegov/calculator-8m 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/georgiyozhegov/calculator-8m. 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/georgiyozhegov/calculator-8m. 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.

Model-calculator.

Works well with simple calculations, but fails with complex ones.

Here's a 6-million parameters model.

Usage

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("georgiyozhegov/calculator-8m")
model = AutoModelForCausalLM.from_pretrained("georgiyozhegov/calculator-8m")

prompt = "find 2 + 3\nstep"

inputs = tokenizer(prompt, return_tensors="pt", return_token_type_ids=False)

with torch.no_grad():
    outputs = model.generate(
        input_ids=inputs["input_ids"],
        attention_mask=inputs["attention_mask"],
        max_length=32,
        do_sample=True,
        top_k=50,
        top_p=0.98
    )

# Cut the rest
count = 0
for index, token in enumerate(outputs[0]):
    if token == 6: count += 1
    if count >= 2: break

output = tokenizer.decode(outputs[0][:index])
print(output)
Downloads last month
37
Safetensors
Model size
8.46M params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Dataset used to train georgiyozhegov/calculator-8m

Space using georgiyozhegov/calculator-8m 1

Collection including georgiyozhegov/calculator-8m