Run this model with HF Jobs

Run stabilityai/stablecode-instruct-alpha-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/stabilityai/stablecode-instruct-alpha-3b. Ask me which dataset to train on, then push the fine-tuned model to a new private 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/stabilityai/stablecode-instruct-alpha-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/stabilityai/stablecode-instruct-alpha-3b. Ask me which benchmark to run, then save the scores and the per-example results to a new private 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/stabilityai/stablecode-instruct-alpha-3b. Push it to a new private model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

Fix code sample to resolve ValueError

#2
by mendhak - opened

The current code sample results in an error:

ValueError: The following model_kwargs are not used by the model: ['token_type_ids']

Adding return_token_type_ids=Falseas an argument to the tokenizer() method resolves this error.

inputs = tokenizer("###Instruction\nGenerate a python function to find number of CPU cores###Response\n", return_tensors="pt", return_token_type_ids=False).to("cuda")

Thanks, came here to post this but where do you put this exactly?

Thanks, came here to post this but where do you put this exactly?

It's passed to the tokenizer, you can see observe in Files changed (next to this discussion).

Sweet, it worked
Thanks @mendhak @sjschubert

I am getting this error when I try to use in pipeline 'Repo model stabilityai/stablecode-instruct-alpha-3b is gated. You must be authenticated to access it.'

@sudhir2016 you can use the HuggingFace CLI to login, it will ask you for a token there. Generate a token in your settings. After that, your downloads should start working.

Thanks, came here to post this but where do you put this exactly?

You have to add the parameter return_token_type_ids=False to the tokenizer(...) function.

inputs = tokenizer(
    "###Instruction\nGenerate a python function to find number of CPU cores###Response\n",
    return_tensors="pt",
    return_token_type_ids=False, # <------------- put this here
).to("cuda")

Even example code is wrong !!! faint

@mendhak I did what you suggested. I am using colab. I logged in successfully using login(). Then tried download like this 'hf_hub_download(repo_id="stabilityai/stablecode-instruct-alpha-3b", filename="config.json"). Still getting this error. Cannot access gated repo for url https://huggingface.co/stabilityai/stablecode-instruct-alpha-3b/resolve/main/config.json.
Access to model stabilityai/stablecode-instruct-alpha-3b is restricted and you are not in the authorized list.

After changing as per the above mentioned code, I am getting

OutOfMemoryError: CUDA out of memory. Tried to allocate 38.00 MiB (GPU 0; 14.75 GiB total capacity; 14.51 GiB already allocated; 16.81 MiB free; 14.63 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation.

I am using below code:

model_id='google/flan-t5-large'
tokenizer=AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSeq2SeqLM.from_pretrained(model_id,device_map='auto')
local_llm = HuggingFacePipeline(pipeline=pipeline)
prompt = PromptTemplate(
    input_variables=["name"],
    template="Tell me about foootballer {name}"
)
chain = LLMChain(llm=local_llm, prompt=prompt)
chain.run("Cristiano Ronaldo")

I am getting this error:
ValueError: The following model_kwargs are not used by the model: ['return_full_text'] (note: typos in the generate arguments will also show up in this list)

Ready to merge
This branch is ready to get merged automatically.

Sign up or log in to comment