Skip to content

[EAGLE-5027] Runners Model run locally#411

Merged
luv-bansal merged 4 commits intomasterfrom
runners_run_locally
Oct 9, 2024
Merged

[EAGLE-5027] Runners Model run locally#411
luv-bansal merged 4 commits intomasterfrom
runners_run_locally

Conversation

@luv-bansal
Copy link
Copy Markdown
Contributor

What

  • This PR implements a ModelRunLocally class that allows users to test and run a runners model locally.
  • It creates a virtual environment, installs required dependencies from requirements.txt, and and tests the model locally.
  • Anyone can simply test their model using
python -m clarifai.runners.models.model_run_locally --model_path <model_path>

Why

  • It simplify the process of testing models locally.
  • By using a virtual environment, it prevents dependency conflicts in requierements.txt.
  • Prevent from model upload failure due to typos in model.py or wrong implementation of model

How

Tests

  • Tested by running the models examples locally

Notes

  • Not sure if model_run_locally is the best name, let me know if need to change

@luv-bansal luv-bansal requested a review from zeiler October 8, 2024 16:07
@luv-bansal luv-bansal changed the title Runners Model run locally [EAGLE-5027] Runners Model run locally Oct 8, 2024
sys.exit(1)

# run the model server
def run_model_server(self):
Copy link
Copy Markdown
Contributor Author

@luv-bansal luv-bansal Oct 8, 2024

Choose a reason for hiding this comment

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

I include this method to start the model runner server locally, but not sure if's useful here, @zeiler what do you think?

Copy link
Copy Markdown
Member

@zeiler zeiler left a comment

Choose a reason for hiding this comment

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

This is great! I think we should have examples of how to call the model very easily too and maybe print out when the local dev server starts how to call it.

@luv-bansal luv-bansal merged commit 8566e25 into master Oct 9, 2024
@luv-bansal luv-bansal deleted the runners_run_locally branch October 9, 2024 06:59
@luv-bansal luv-bansal mentioned this pull request Oct 9, 2024
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