Run this model with HF Jobs

Run google/gemma-2-2b 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/google/gemma-2-2b. 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/google/gemma-2-2b 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/google/gemma-2-2b. 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/google/gemma-2-2b. 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.

Question about Gemma2:2b system prompt template and usage in Langflow

#26
by MarcusWey - opened

Hello Hugging Face community! 👋

I'm currently experimenting with Gemma2:2b and was wondering if anyone could help clarify something. Specifically, what kind of system prompt template does Gemma2:2b use? For example, how do you assign a specific role to the model, provide instructions, and set restrictions on what it should or shouldn't do?

Additionally, has anyone tried using Gemma2:2b within Langflow?

Thanks in advance for any insights! 😊

Hi @MarcusWey , Gemma2:2b doesn’t inherently support "system" instructions. Instead, roles like "user" and "model" are explicitly defined using specific tokens, and the model follows these directives accordingly. This method allows you to give the model instructions, define its role in a conversation, and guide how it processes the input.
image.png

However, when working with the instruction-tuned ("it") version (like gemma-2-2b-it), specific formatting is required to assign roles, give instructions, and set rules for the model's behavior. In this version, control tokens such as , , user, and model are used to structure the conversation, making it more suited for dialogue or interactive tasks.

Here’s a sample code using the Gemma2:2b-it model with a system prompt template.

image.png

Kindly find above attached screenshots. if you have any concerns let me know. Thank you.

Sign up or log in to comment