Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example code from mario_gpt should possibly be mario_gpt.lm #5

Closed
mossly opened this issue Feb 16, 2023 · 6 comments
Closed

Example code from mario_gpt should possibly be mario_gpt.lm #5

mossly opened this issue Feb 16, 2023 · 6 comments

Comments

@mossly
Copy link

mossly commented Feb 16, 2023

Hi,

First of all thanks for your novel implementation! This is very cool to see.

When running the minimal code snippet provided in the readme, I got the following error:

C:\Users\Mossly\Desktop>py mariotest.py
Traceback (most recent call last):
  File "C:\Users\Mossly\Desktop\mariotest.py", line 1, in <module>
    from mario_gpt import MarioLM
ImportError: cannot import name 'MarioLM' from 'mario_gpt' (C:\Users\Mossly\AppData\Local\Programs\Python\Python310\lib\site-packages\mario_gpt\__init__.py)

I resolved it by changing the line:
from mario_gpt import MarioLM
to
from mario_gpt.lm import MarioLM

Perhaps this is just a simple syntactical mistake? Or it could be user error on my part...

Thanks for your attention!

@shyamsn97
Copy link
Owner

Hey! So I actually updated the code to make this importing possible, but I realized that the pypi package has not really been updated yet. I reverted this back in the README so it should be good :)

@mossly
Copy link
Author

mossly commented Feb 16, 2023

Thanks for your assistance!

I'm pretty close to getting things working but hit another error I've been unable to debug.

generated_level = mario_lm.sample(
File "lm.py", line 113, in sample
[self.prompter.output_hidden(prompt) for prompt in prompts]
File "lm.py", line 113, in
[self.prompter.output_hidden(prompt) for prompt in prompts]
File "prompter.py", line 117, in output_hidden
.mean(0)
AttributeError: 'list' object has no attribute 'mean'

This is using the default prompts = ["many pipes", "many enemies", "some blocks", "high elevation"]

Any help would be greatly appreciated!

@shyamsn97
Copy link
Owner

Hey! So multiple prompts should now work. You should probably clone the repo or update from pypi. On another note, when using default prompts make sure you're using:

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

instead of

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

If you split the categories the model could still work, but I haven't tested that out extensively.

@shyamsn97
Copy link
Owner

Also, make sure you update your transformers package :)

@shyamsn97
Copy link
Owner

Thanks for pointing this out though, lmk if there's any other errors!

@mossly
Copy link
Author

mossly commented Feb 16, 2023

I updated the repo, transformers, fixed up the prompts as per your advice, and now everything is working on Windows 11 with Python 3.10.

Thanks again for all your help! :)

level

@mossly mossly closed this as completed Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants