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

Make it possible to install with pip #81

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

bfirsh
Copy link

@bfirsh bfirsh commented Jul 16, 2021

This pull request makes it possible to do:

pip install git+https://github.com/CompVis/taming-transformers.git

I have done this by:

  1. Using find_namespace_packages() instead of find_packages() so setuptools can find packages without __init__.py
  2. Put instantiate_from_config inside the taming package so it is importable

ref #62 #30

@Evarin
Copy link

Evarin commented Jul 28, 2021

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!

@rom1504
Copy link
Contributor

rom1504 commented Aug 13, 2021

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!

@bfirsh bfirsh force-pushed the module branch 2 times, most recently from 1b89947 to fefe15a Compare September 28, 2021 23:45
@bfirsh
Copy link
Author

bfirsh commented Sep 28, 2021

@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

@@ -3,7 +3,7 @@
import numpy as np
from omegaconf import OmegaConf
from PIL import Image
from main import instantiate_from_config, DataModuleFromConfig
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DataModuleFromConfig is unused in the scripts.

@bfirsh
Copy link
Author

bfirsh commented Nov 10, 2021

I have rebased this and fixed conflicts. @rromb @pesser @manolo-lolo does this look good? :)

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

Successfully merging this pull request may close these issues.

3 participants