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.

Why is this completely broken?

#11
by rombodawg - opened

I ran the fp16 files in transformers, and the gguf files in llamacpp. And both cannot output code at all. Literally just spits out garbage. How can you saw you improved the model when its just complete garbage? Am i missing something here? Is there some setting I need to enable to make this not trash? I really want this to be a good model, but you guys arent leaving me with much hope here.

Like look at this
User:

Write the classic game of "snake" in python using pygame

Ai:

import random, sys  # Import necessary modules for randomness and system handling respectively   



class SnakeGame():     # Define class representing snake Game state                                                                     -*-*--~-*~~---~~~------+ *********/ \r\n' '*'- ~ - _`_ `"* ' "* '_ / |__| ||_/ \|_| \_/-._/_ '-~/~\ '. __init__(self):          pass                                               \\                   //               //_/\                  \/                 \_/)              )            }             






def main() :                        ## Main function where gameplay logic resides                          \\\                         ||                       /'                      (c =Snakegame())                     )\__.update()`                    '/', c.__draw__() ) while True; del (sys); return ; 

What prompt template do you use?

  • transformers-4.40.0.dev0
  • torch_dtype=torch.bfloat16,
<bos><start_of_turn>user
Write the classic game of "snake" in python using pygame<end_of_turn>
<start_of_turn>model
``python
import pygame
import random

# Initialize the game engine
pygame.init()

# Set the game screen size
SCREEN_WIDTH = 640
SCREEN_HEIGHT = 480
screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))

# Create the snake object
snake = pygame.sprite.Sprite()
snake.image = pygame.Surface((20, 20))
snake.image.fill((0, 255, 0))
snake.rect = snake.image.get_rect()
snake.rect.center = (SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2)

# Create the food object
food = pygame.sprite.Sprite()
food.image = pygame.Surface((20, 20))
food.image.fill((255, 0, 0))
food.rect = food.image.get_rect()
food.rect.x = random.randint(0, SCREEN_WIDTH - food.rect.width)
food.rect.y = random.randint(0, SCREEN_HEIGHT - food.rect.height)

# Set the game state
running = True
clock = pygame.time.Clock()
score = 0

# Game loop
while running:
    # Handle events
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False

    # Update the snake's position
    snake.rect.move_ip(5, 0)

    # Check for collisions with the food
    if pygame.sprite.collide_rect(snake, food):
        food.rect.x = random.randint(0, SCREEN_WIDTH - food.rect.width)
        food.rect.y = random.randint(0, SCREEN_HEIGHT - food.rect.height)
        score += 1

    # Check for collisions with the walls
    if snake.rect.left < 0 or snake.rect.right > SCREEN_WIDTH:
        running = False
    if snake.rect.top < 0 or snake.rect.bottom > SCREEN_HEIGHT:
        running = False

    # Draw the game screen
    screen.fill((0, 0, 0))
    screen.blit(snake.image, snake.rect)
    screen.blit(food.image, food.rect)
    pygame.display.update()

    # Limit the frame rate
    clock.tick(10)

# Quit the game engine
pygame.quit()
``

**How to play:**

* Use the arrow keys to move the snake.
* Eat the food to increase your score.
* Avoid colliding with the walls or the snake's body.

**Features:**

* Classic snake gameplay.
* Randomly generated food position.
* Collision detection with walls and food.
* Score tracking.<eos>

Hi ,

Thank you for reaching out and sharing your experience. The output you're seeing is definitely not the expected behavior.

Instruction-tuned or chat models like Gemma are trained to follow a specific conversational structure, marked by special "control tokens.

The correct format for Gemma models looks like this:

<bos><start_of_turn>user {YOUR PROMPT HERE}<end_of_turn> <start_of_turn>model

So, for your request, the full prompt string sent to the model should be:

<bos><start_of_turn>user Write the classic game of "snake" in python using pygame<end_of_turn> <start_of_turn>model

And also add --chat-template gemma, llama.cpp will wrap your prompt in the correct user... structure before feeding it to the model. Kindly try and and let us know, if you have any concerns will assist you . Thank you.

Sign up or log in to comment