-
Notifications
You must be signed in to change notification settings - Fork 9
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
[CLOSED] Make jiant pip installable #887
Comments
Comment by pep8speaks Hello @davidbenton! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 You can repair most issues by installing black and running: Comment last updated at 2019-08-24 00:19:26 UTC |
Comment by davidbenton see #877 |
Comment by davidbenton I see I need to get demo.py running to pass CI, which should be straightforward. I have just been running The PEP 8 issues aren't picked up by black locally, and I'm not sure why, but I'll clean that up too. |
Comment by davidbenton Okay, minor changes made. crossing my fingers on CI Another item to note: if these changes are going in the right direction, documentation will need some updates, including change to config paths and pip installation. |
Comment by sleepinyourhat Also: We haven't been enforcing the PEP8 issues that don't also pop up in Black, though some of them can still be worth looking at. We should probably turn off the PEP8 bot... Thanks! |
Comment by sleepinyourhat And to confirm, this generally all looks productive/reasonable. LMK when it's ready for a final look. |
Comment by davidbenton Thanks for review and comments! I'm glad it's going in the right direction. @pruksmhc I ran the boolq task locally using @sleepinyourhat Functionally, I think we have pip-installability complete, but depending what they're doing, users might run into some issues using jiant via pip. Specifically, they won't have easy access to the config files or shell scripts. You can see examples of this in my pip tutorial recipe above, where data and Do we need to make it easier for pip users to get config files or use some shell scripts? If yes, is that in scope for #877, or open new issue for it? |
Comment by sleepinyourhat That sounds reasonable. This PR seems to be net helpful as long as the standard workflow (clone, create/edit config files, modify code) isn't any harder. We don't have a great case study workflow to try that would involve pip yet, though. Once we start experimenting with flambé and similar tools, the pain points will become clearer. |
Comment by davidbenton After a thorough review, I see that Is a symlink reasonable to make |
Comment by sleepinyourhat I suspect people will often want to name other config files explicitly, both at the command line, and as inheritances within their new config files, so we'll need to make sure that's relatively painless/documented. I'm fine with symlinks if they're generally supported/safe for multi-platform git projects. |
Comment by davidbenton Symlink will work for most, but I am not confident it works for all Windows users, so I will move all config to the package (as it is in the PR now), update paths, and document. I think I have what I need, and I'll update the PR tomorrow. |
Comment by davidbenton Got hung up debugging the CircleCI changes, but I have a pip environment passing tests there now. Not finished with other work, but going to call it a day on this. Will pick this up by the end of the week. |
Comment by davidbenton Okay, I think this is ready for review @sleepinyourhat. Note the significant changes to CircleCI, and let me know if you have questions about anything there. I saw in my merge just now that nyu-mll/jiant#897 specified a version of conda, which this wipes out. Not sure if that's a red flag or not. I updated config paths everywhere, but did not attempt to run every script, etc. I did, as noted above, run one task from |
Comment by davidbenton Oh, and I'll create the documentation PR if the |
Comment by davidbenton Great! You'll need to create a PyPI account to upload package distributions, if you don't have one, and then the notes in setup.py should cover it. |
Comment by HaokunLiu Hey @davidbenton , I need to verify a new branch in jiant is pip installable, what do I need to do? |
Comment by sleepinyourhat Installing git repos with pip should be pretty standard. Roughly, IIRC: Make a clone/copy of the repo, exit any environment/virtualenv you're using that already has jiant set up, and run something like |
Comment by davidbenton @HaokunLiu Everything above seems right, but I'd recommend going a step further and creating a new virtual environment to make sure you're not pulling from existing global/user installed dependencies. The CircleCI config.yml steps create a virtual environment and pip install the package from local filesystem, so you can use that as a recipe, if it's helpful. |
Comment by HaokunLiu Thanks, I finally did it. |
Comment by davidbenton Yes, that's right. As pip use cases emerge, it might be necessary to add some more checks, but CircleCI currently does basic package installation via pip, including dependencies. |
Comment by HaokunLiu @davidbenton I've got another problem. Using RoBERTa tokenizer needs to run "python -m spacy download en". I can manually run this when running experiments. But when I'm using Robert tokenizer in a test script, there is no place for me to ask spacy to download en. Is there any way we can do this in setup, or somewhere else? |
Issue by davidbenton
Tuesday Aug 13, 2019 at 17:40 GMT
Originally opened as nyu-mll/jiant#887
This should be considered a work-in-progress, not a complete PR. It passes tests, but might break some untested things, and there are a few things I'll flag for review.
Because I'm still getting to know jiant, I chose running the tutorial experiment using a pip-installed package as my goal. This changeset allows that (without requiring conda or manual dependency installation). It doesn't directly address setting up an environment or downloading data using the pip package. To try it yourself, you can:
Some items worth reviewing:
default.conf
, for example.main.main()
intojiant.__main__
for convenience of runningpython -m jiant
, and to keep necessary code inside thejiant
package. I kept main.py for backward compatibility, and there's some duplicated code, but not too much.davidbenton included the following code: https://github.com/nyu-mll/jiant/pull/887/commits
The text was updated successfully, but these errors were encountered: