Open abrichr opened 2 years ago
When running the model via docker run, POSTing to the endpoint with the image parameter set to a url (with or without the leading @) returns HTTP 400:
docker run
POST
image
@
{"message": "Could not convert file input image to Path"}
Changing the type to str resolves the issue. Also, the following import is missing:
type
str
from urllib.request import urlopen
Edit: we also need to check for an empty string:
--- a/predict.py +++ b/predict.py @@ -140,7 +140,7 @@ class Predictor(cog.Predictor): toksX, toksY = self.args.size[0] // f, self.args.size[1] // f sideX, sideY = toksX * f, toksY * f - if image is not None: + if image: self.args.init_image = str(image) self.args.step_size = 0.25 if "http" in self.args.init_image:
When running the model via
docker run
,POST
ing to the endpoint with theimage
parameter set to a url (with or without the leading@
) returns HTTP 400:Changing the
type
tostr
resolves the issue. Also, the following import is missing:Edit: we also need to check for an empty string: