Run this model with HF Jobs

Run replit/replit-code-v1-3b 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/replit/replit-code-v1-3b. 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/replit/replit-code-v1-3b 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/replit/replit-code-v1-3b. 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/replit/replit-code-v1-3b. 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 GPU instead of CPU ? "you are using config.init_device='cpu', but you can also use config.init_device="meta"

#30
by ali-issa - opened

When attempting to execute this code in Colab, I encountered the following error: "You are using config.init_device='cpu', but you can also use config.init_device="meta" with Composer + FSDP for fast initialization." Subsequently, the CPU resources became fully utilized, leading to a session crash.

The code I utilized:

from transformers import AutoModelForCausalLM, AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("glaiveai/glaive-function-calling-v1", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("glaiveai/glaive-function-calling-v1", trust_remote_code=True).half().cuda()

inputs = tokenizer(prompt, return_tensors="pt").to(model.device)

outputs = model.generate(**inputs, do_sample=True, temperature=0.1, top_p=0.95, max_new_tokens=100)

print(tokenizer.decode(outputs[0], skip_special_tokens=True))

just change the code(it's open-sourced). simple 😎

Sign up or log in to comment