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

[proposal] make the CLI available without cloning the repo #373

Closed
wants to merge 6 commits into from

Conversation

Eraz1997
Copy link
Contributor

@Eraz1997 Eraz1997 commented Feb 2, 2024

hey 👋

This repo and the job you did is amazing! I wanted to contribute with this PR with something I'd value when it comes to some of my personal projects. I'm not sure this is something you want to upstream as well, so I marked it as a "proposal".

With all these changes, I actually just moved the bin/train/main.py script inside the package to make it available to users installing the nam PyPi package without having to clone the whole repo.

Since there's no "bin" inside the bin folder anymore, I moved the bin/train one at the root level.

Finally, I aligned the README with these changes (+ I removed some old, I guess, paragraphs)

I hope it can be of any help 💪

@Eraz1997
Copy link
Contributor Author

Eraz1997 commented Feb 2, 2024

Additional note, I’m honestly unsure whether running the CLI script outside of conda changes anything, even though from my understanding it shouldn’t

@sdatkinson
Copy link
Owner

I like this idea. However, your PR does unfortunately introduce a lot of issues that need to get addressed before I can merge it.

I'll need to find some time to review this.

@Eraz1997
Copy link
Contributor Author

Eraz1997 commented Feb 8, 2024

Oh, I’m sorry I haven’t noticed them! If you give me some pointers I can try to address the issues 💪

One thing I just noticed is that pytorch-cuda is missing if you don’t run the CLI inside the conda environment. I can think about a solution, if needed.

Copy link
Owner

@sdatkinson sdatkinson left a comment

Choose a reason for hiding this comment

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

See notes

README.md Outdated
@@ -29,32 +29,9 @@ After installing the Python package, a GUI can be accessed by running `nam` in t

### The command line trainer (all features)

Alternatively, you can clone this repo to your computer and use it locally.
Copy link
Owner

Choose a reason for hiding this comment

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

[BLOCKING] Don't delete this. This is instructions for how to do development with the repo.

It's ok w/ me if you want to add some small section saying that pip install neural-amp-modeler is a thing if you want to depend on it w/o modifying it. But I want developers to understand how to correctly set up their development environment.

Copy link
Contributor Author

@Eraz1997 Eraz1997 Mar 26, 2024

Choose a reason for hiding this comment

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

Sounds good 👌 My (obviously questionable) suggestion is to clarify what is a CONTRIBUTING guide and what are usage guidelines. This paragraph looks more like user guidelines, so I'd specify that.

I'll leave them as they are and possibly add just a paragraph about pip 💪

nam/train/cli.py Outdated
@@ -225,11 +225,15 @@ def main_inner(
model.net.export(outdir)


if __name__ == "__main__":
def main():
Copy link
Owner

Choose a reason for hiding this comment

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

[Nit] Now that there are 3 different "entry points" with different interfaces, it'd probably be good to docstring why they're all here and what they achieve [I can handle this.]

@Eraz1997
Copy link
Contributor Author

I rewrote the PR from scratch as I thought it'd have been simpler - and indeed I came up with way fewer and leaner changes IMHO 🚀

Sorry for the first round of review, it must have been tough as the PR was a bit messy and changed a lot of things I didn't quite check you agreed with before 🙏

What mainly changes from the "previous version of the PR" is:

  • I kept files at their place
  • I didn't remove any documentation, just added a tiny paragraph about pip and the new nam-cli command

I kept files at their place

I guess this is what you were referring to when you mentioned the broken test - indeed nam-cli was working perfectly fine, but if you meant the python bin/train/main.py ... command, then yes, it broke because I intentionally replaced it with nam-cli, but indeed I should have checked it with you first! 🙏

Thanks!! 😊

@Eraz1997 Eraz1997 requested a review from sdatkinson March 26, 2024 17:53
Copy link
Owner

@sdatkinson sdatkinson left a comment

Choose a reason for hiding this comment

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

Overall, this looks great!

I can take care of the nits and checks myself, but thanks for taking the initiative on this--I like it 👍🏻

@@ -38,6 +38,29 @@ Then activate the environment you've created with

conda activate nam

Alternative: directly install the PyPi package
Copy link
Owner

Choose a reason for hiding this comment

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

Nit: PyPI


pip install neural-amp-modeler

In this case, you can just run `nam-cli` in your shell instead of cloning the repository and running the `bin/train/main.py` script as explained below in the training section.
Copy link
Owner

Choose a reason for hiding this comment

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

  1. In rst it's two backticks, not one (little different from Markdown)

  2. Let's call it nam-full

plot(model, dataset_validation, show=not no_show)
# Export!
model.net.export(outdir)
from nam.train.cli import run
Copy link
Owner

Choose a reason for hiding this comment

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

Know what? Let's just remove this file altogether. I'm looking to do a release that makes breaking changes; might as well put this break as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds great to me 🚀

# See:
# https://github.com/sdatkinson/neural-amp-modeler/issues/105
# https://stackoverflow.com/a/44822794
def _ensure_graceful_shutdowns():
Copy link
Owner

Choose a reason for hiding this comment

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

[Critical] Does this still work? I'll want to check.

@@ -55,6 +55,7 @@ def get_additional_requirements():
entry_points={
"console_scripts": [
"nam = nam.train.gui:run",
"nam-cli = nam.train.cli:run",
Copy link
Owner

Choose a reason for hiding this comment

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

nam-full

@Eraz1997
Copy link
Contributor Author

Great!! LMK if you want me to help somehow 🚀 Thank you!

@sdatkinson
Copy link
Owner

@Eraz1997 on second thought, if you can grab those changes before Thursday you'll probably get to it before me :)

@Eraz1997
Copy link
Contributor Author

@sdatkinson unfortunately I don't have band this week, LMK if it can be of any help next week as well!

@sdatkinson
Copy link
Owner

Got the nits and did a bit of cleanup on the documentation in Eraz1997/main.

Closing this PR and we'll merge there 👍🏻

@Eraz1997
Copy link
Contributor Author

Perfect!! 🚀

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.

2 participants