taming-transformers
taming-transformers copied to clipboard
Make it possible to install with pip
This pull request makes it possible to do:
pip install git+https://github.com/CompVis/taming-transformers.git
I have done this by:
- Using
find_namespace_packages()instead offind_packages()so setuptools can find packages without__init__.py - Put
instantiate_from_configinside thetamingpackage so it is importable
ref #62 #30
Hi! I wanted to use your code, but I found a small issue with your PR: you forgot to remove the from main import ... lines in files taming/models/vqgan.py, taming/models/cond_transformer.py and scripts/sample_fast.py. After removing those lines, I could install the package locally and run the part of the package I was interested in.
(There are also a number of dependencies that are not indicated in setup.py that I had to download by hand, among which pytorch-lightning and einops, it might be convenient to add them?)
Thanks for making the PR!
fyi I already did something similar at https://github.com/rom1504/taming-transformers and released it to pypi at https://pypi.org/project/taming-transformers-rom1504/
if the authors want to maintain their pypi package, I'd gladly PR that though!
@Evarin Good catch -- fixed all this stuff. Thanks!
I have also added a simple GitHub actions check that makes sure the package is importable after pip install. This will make sure it remains installable over time.
@rromb @pesser I think this is ready to review/merge now! I think you might need to click a button to get GitHub actions to run. It passes on my fork: https://github.com/bfirsh/taming-transformers/runs/3738638366
I have rebased this and fixed conflicts. @rromb @pesser @manolo-lolo does this look good? :)