Sasha Rush commited on
Commit
aaff3c0
Β·
1 Parent(s): b893f76
Files changed (1) hide show
  1. app.py +13 -13
app.py CHANGED
@@ -363,24 +363,24 @@ with gr.Blocks() as app:
363
  # test = gr.Code(label="test")
364
  # im2 = gr.Gallery()
365
  # im2.style(preview=True)
366
- gr.Markdown("""
367
- # GPTWorld
368
-
369
- GPTWorld is a prompting game. Your goal is to get an LLM to complete a maze. If you can do this successfully, it will be able to navigate itself through the world from the start (o) to the key the exit (x). In the bottom right we show you a sample target output of GPT for a maze. Your goal is to get the model to generate this from scratch for an unseen maze.
370
-
371
-
372
- The game takes place on a hexagonal grid with walls. Even rows are labeled (0,0), (0, 2), (0,4) and odd rows are labeled (1, 1), (1, 3), (1, 5). This was done to make the puzzle a bit less common.
373
-
374
  """)
375
 
376
  with gr.Row():
377
  with gr.Column():
378
- game_desc = gr.Text(label="Game")
379
  examples = gr.Radio(show_label=False,
380
  choices=["Easy", "Medium", "Hard", "Evil"])
381
  api_key = gr.Text(label="OpenAI Key", type="password",
382
  value=os.environ.get("OPENAI_API_KEY"))
383
- prompt = gr.Code(label="prompt", language="python", lines=40, value=f"""
384
  # A prompt to describe this game to the GPT model.
385
 
386
  # Ideas:
@@ -416,10 +416,10 @@ def move(board, action, old_pos):
416
  start_btn = gr.Button("Prompt >")
417
  cancel_btn = gr.Button("Cancel")
418
  with gr.Column():
419
- im = gr.Gallery()
420
- im.style(preview=True)
421
 
422
- output = gr.Code(language="python", value="""def my_example():
423
  b = Game(init=(0, 0), flag=(2, 2), walls= [], boundary= (3, 3), key= (1, 1))
424
  p = (0, 0)
425
  # This is the code you want it to generate.
 
363
  # test = gr.Code(label="test")
364
  # im2 = gr.Gallery()
365
  # im2.style(preview=True)
366
+ gr.HTML("""
367
+ <center>
368
+ <h1>🌎 GPTWorld 🌍</h1>
369
+
370
+ <p>
371
+ GPTWorld is a prompting game. Your goal is to get an LLM to complete a maze. You start at (o) need to first get the key and then reach the exit (x). The game takes place on a hexagonal grid with walls [Even rows are labeled (0,0), (0, 2), (0,4) and odd rows are labeled (1, 1), (1, 3), (1, 5)]. You play by prompting GPT to write code which solves the game on the right.
372
+ </p>
373
+ </center>
374
  """)
375
 
376
  with gr.Row():
377
  with gr.Column():
378
+ game_desc = gr.Text(label="Game (Select one first or make your own)")
379
  examples = gr.Radio(show_label=False,
380
  choices=["Easy", "Medium", "Hard", "Evil"])
381
  api_key = gr.Text(label="OpenAI Key", type="password",
382
  value=os.environ.get("OPENAI_API_KEY"))
383
+ prompt = gr.Code(label="Prompt (This is for you to fill out)", language="python", lines=40, value=f"""
384
  # A prompt to describe this game to the GPT model.
385
 
386
  # Ideas:
 
416
  start_btn = gr.Button("Prompt >")
417
  cancel_btn = gr.Button("Cancel")
418
  with gr.Column():
419
+ im = gr.Gallery(label="Gallery of the Game")
420
+ im.style(preview=True, object_fit="scale-down", columns=1, container=True)
421
 
422
+ output = gr.Code(label="Generating Game Code (You can also edit and rerun)", language="python", value="""def my_example():
423
  b = Game(init=(0, 0), flag=(2, 2), walls= [], boundary= (3, 3), key= (1, 1))
424
  p = (0, 0)
425
  # This is the code you want it to generate.