Added local-runner requirements validation step #712
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR link - https://clarifai.atlassian.net/browse/PR-742
This pull request introduces enhancements to the
clarifai/cli/model.py
andclarifai/utils/cli.py
files, focusing on improving dependency checks, model customization, and error handling for the Ollama toolkit. The most significant changes include the addition of utility functions for verifying prerequisites, relocating thecustomize_ollama_model
function, and enhancing validation logic for toolkit-specific operations.Enhancements for dependency and toolkit checks:
check_ollama_installed
function to verify if the Ollama CLI is installed. This function is now used in theinit
command to prevent execution when Ollama is missing. (clarifai/utils/cli.py
,clarifai/cli/model.py
) [1] [2]check_requirements_installed
function to ensure all dependencies specified inrequirements.txt
are installed. This check is integrated into thelocal_runner
command to improve dependency validation. (clarifai/utils/cli.py
,clarifai/cli/model.py
) [1] [2]Refactoring and relocation:
customize_ollama_model
function fromclarifai/cli/model.py
toclarifai/utils/cli.py
for better modularity and reusability. (clarifai/utils/cli.py
,clarifai/cli/model.py
) [1] [2]Code cleanup:
clarifai/cli/model.py
to use multi-line format for improved readability and maintainability. (clarifai/cli/model.py
)