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>

Sign up or log in to comment