Run this model with HF Jobs

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

TemplateError: System role not supported

#15
by luogy - opened

The question is the same as the title.
Does Gemma-1.1 not support{"role": "system", "content": system_prompt}?

     27 messages = [
     28     {
     29         "role": "system",
   (...)
     33     {"role": "user", "content": user_input},
     34 ]
---> 36 prompt = pipe.tokenizer.apply_chat_template(messages,
     37                                             tokenize=False,
     38                                             add_generation_prompt=True)
     41 outputs = pipe(prompt,
     42                max_new_tokens=256,
     43                do_sample=True,
     44                temperature=0.7,
     45                top_k=50,
     46                top_p=0.95)
     48 generated_outputs = outputs[0]["generated_text"]
...
File ~/mambaforge/envs/ollama/lib/python3.11/site-packages/transformers/tokenization_utils_base.py:1828, in PreTrainedTokenizerBase._compile_jinja_template.<locals>.raise_exception(message)
   1827 def raise_exception(message):
-> 1828     raise TemplateError(message)

TemplateError: System role not supported

I am also having this issue

Google org

System instructions is not supported directly but you can start the prompt with the instruction "you are an expert in computer and ..." or something like that and the model will follow

Hello!
This way, the user will be able to modify the original purposes of the model. Ideally, the user should not be able to modify the model's operating principles. How to do this?

omg

•
This comment has been hidden

is there any update on this?

Hi @luogy ,

Gemma-1.1 likely doesn't support the "system" role format used by other models. The error is being raised during the call to apply_chat_template(), which suggests that the tokenizer or template handler does not accept "system" as a valid role. If you want the model to follow certain instructions or be in a specific role, include those instructions directly in the user_input instead of using a separate system role.

Thank you.

Sign up or log in to comment