shyamsn97 / mario-gpt

[Neurips 2023] Generating Mario Levels with GPT2. Code for the paper "MarioGPT: Open-Ended Text2Level Generation through Large Language Models" https://arxiv.org/abs/2302.05981
https://huggingface.co/shyamsn97/Mario-GPT2-700-context-length
MIT License
1.11k stars 100 forks source link

Why this mario gpt script is laggy? #30

Open DrFrankatron opened 5 months ago

DrFrankatron commented 5 months ago

This is the script:

from mario_gpt import MarioLM

mario_lm = MarioLM()

prompts = ["many pipes, many enemies, some blocks, high elevation"]

generated_level = mario_lm.sample( prompts=prompts, num_steps=100, temperature=2.0, use_tqdm=True )

play in interactive

generated_level.play()

run Astar agent

generated_level.run_astar()

And I need more num_steps, but the AI lags when it reach more than 100 steps... its possible to get performance with this python library?

DrFrankatron commented 5 months ago

This is my code, sorry the bad formatted previous one:

from mario_gpt import MarioLM

mario_lm = MarioLM()

prompts = ["many pipes, many enemies, some blocks, high elevation"]

generated_level = mario_lm.sample( prompts=prompts, num_steps=100, temperature=2.0, use_tqdm=True )

generated_level.play()

generated_level.run_astar()

shyamsn97 commented 4 months ago

Hey! Are you sure you’re using a gpu? It can be pretty slow without one. Basically has the steps increase the information in the context increases.

shyamsn97 commented 4 months ago

You can check with torch.cuda.is_available()