Skip to content

Commit

Permalink
allow setup(self, weights: str)
Browse files Browse the repository at this point in the history
Signed-off-by: technillogue <technillogue@gmail.com>
  • Loading branch information
technillogue committed Mar 5, 2024
1 parent 46d0eb3 commit 81f9659
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/cog/predictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ def run_setup(predictor: BasePredictor) -> None:
elif weights_type == CogPath:
# TODO: So this can be a url. evil!
weights = cast(CogPath, CogPath.validate(weights_url))
# allow people to download weights themselves
elif weights_type == str:
return weights_url
else:
raise ValueError(
f"Predictor.setup() has an argument 'weights' of type {weights_type}, but only File and Path are supported"
Expand Down

0 comments on commit 81f9659

Please sign in to comment.