Traingenerator

Category :

A web app to generate template code for machine learning




Code style: black

Traingenerator is now live!

Try it out: https://traingenerator.streamlitapp.com

Introduction

Are you looking for a quick way to kickstart your machine learning projects? Traingenerator is the perfect tool! It allows you to generate custom template code for PyTorch and Scikit-learn, using a simple web UI built with streamlit. The application provides multiple options for preprocessing, model setup, training, and visualization with tools like Tensorboard or comet.ml. The generated code can be exported to various formats such as .py files, Jupyter Notebooks, or even Google Colab notebooks.

Adding New Templates

Want to make Traingenerator even better by adding your custom templates? You can do that in just four easy steps! Think of it like adding a new aisle in a grocery store – you just need to set everything up correctly for shoppers (users) to benefit from it.

Steps to Create a New Template:

  1. Create a folder under .templates. The folder name should reflect the task of your template, like “Image Classification.” You can include the framework in the name, too.
  2. Add a file sidebar.py to the folder. This file should contain a method show(), displaying all template-specific components in the sidebar, and it must return user inputs.
  3. Add a code-template.py.jinja file. This Jinja2 template generates the code. You can utilize normal Python code and modify it based on sidebar inputs.
  4. Optional: Add a test-inputs.yml file. Define possible user inputs that can be used for testing (helpful for contributing templates).

Installation

To use Traingenerator locally, follow these instructions:

bash
git clone https://github.com/jrieke/traingenerator.git
cd traingenerator
pip install -r requirements.txt

Note: You only need to install Traingenerator if you wish to contribute or run it locally. If you just want to use it, visit https://traingenerator.streamlitapp.com.

Running Locally

To run the app locally, execute:

bash
streamlit run app/main.py

Always run this command from the traingenerator directory to ensure the app finds the necessary templates.

Deploying to Heroku

To share your creation with the world, deploy it to Heroku. Follow these steps:

bash
heroku create
git push heroku main
heroku open

To update, just commit your changes and push them again.

Troubleshooting

If you encounter issues, try the following tips:

  • Ensure you are running commands from the correct directory.
  • If the Open in Colab button shows an error, verify your GitHub repo setup as mentioned above.
  • Check that all required Python packages are installed properly.
  • For any app-related questions or if you want to collaborate, consider joining our community:
  • For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

Conclusion

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox

Latest Insights

© 2024 All Rights Reserved

×