Spaces:
Runtime error
Runtime error
Sasha Rush commited on
Commit ยท
aaff3c0
1
Parent(s): b893f76
save
Browse files362 unmodified lines36336436536636736836937037137237337437537637737837938038138238338438538629 unmodified lines416417418419420421422423424425362 unmodified lines# test = gr.Code(label="test")# im2 = gr.Gallery()# im2.style(preview=True)gr.Markdown("""# GPTWorldGPTWorld 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.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.""")with gr.Row():with gr.Column():game_desc = gr.Text(label="Game")examples = gr.Radio(show_label=False,choices=["Easy", "Medium", "Hard", "Evil"])api_key = gr.Text(label="OpenAI Key", type="password",value=os.environ.get("OPENAI_API_KEY"))prompt = gr.Code(label="prompt", language="python", lines=40, value=f"""# A prompt to describe this game to the GPT model.# Ideas:29 unmodified linesstart_btn = gr.Button("Prompt >")cancel_btn = gr.Button("Cancel")with gr.Column():im = gr.Gallery()im.style(preview=True)output = gr.Code(language="python", value="""def my_example():b = Game(init=(0, 0), flag=(2, 2), walls= [], boundary= (3, 3), key= (1, 1))p = (0, 0)# This is the code you want it to generate.362 unmodified lines36336436536636736836937037137237337437537637737837938038138238338438538629 unmodified lines416417418419420421422423424425362 unmodified lines# test = gr.Code(label="test")# im2 = gr.Gallery()# im2.style(preview=True)gr.HTML("""<center><h1>๐ GPTWorld ๐</h1><p>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.</p></center>""")with gr.Row():with gr.Column():game_desc = gr.Text(label="Game (Select one first or make your own)")examples = gr.Radio(show_label=False,choices=["Easy", "Medium", "Hard", "Evil"])api_key = gr.Text(label="OpenAI Key", type="password",value=os.environ.get("OPENAI_API_KEY"))prompt = gr.Code(label="Prompt (This is for you to fill out)", language="python", lines=40, value=f"""# A prompt to describe this game to the GPT model.# Ideas:29 unmodified linesstart_btn = gr.Button("Prompt >")cancel_btn = gr.Button("Cancel")with gr.Column():im = gr.Gallery(label="Gallery of the Game")im.style(preview=True, object_fit="scale-down", columns=1, container=True)output = gr.Code(label="Generating Game Code (You can also edit and rerun)", language="python", value="""def my_example():b = Game(init=(0, 0), flag=(2, 2), walls= [], boundary= (3, 3), key= (1, 1))p = (0, 0)# This is the code you want it to generate.
app.py+13-13