cog
cog copied to clipboard
Does cog support multiple Path input? e.g. List[Path] as input?
File "/root/.pyenv/versions/3.9.18/lib/python3.9/site-packages/cog/predictor.py", line 239, in get_input_type
raise TypeError(
TypeError: Unsupported input type list for parameter `model_faces`. Supported input types are: str, int, float, bool, cog.File, cog.Path.
ⅹ Failed to get type signature: exit status 1
I got error as above when I try to build the below Predictor(...)
def predict(
self,
target_image: Path = Input(
description="Faces in target image would be changed.",
),
model_faces: list[Path] = Input(
description="Model Faces would be swapped into target image.",
default=None,
),
inference_mode: str = Input(
default="swap",
choices=["swap", "detect"],
description="Face swap mode or detection mode. Default is swap.",
),
) -> Union[List[tuple], List[Path]]:
"""Run a single prediction on the model"""
Does cog support a List of Path as input in any method? In my scenario, I wish to make multiple faces processing in one HTTP API calling instead of 6-7 times HTTP latency.
Which cog version are you using? You may have more luck with one of the 0.9 beta's, which support list and union inputs.
@yorickvP how do you use that?
Which cog version are you using? You may have more luck with one of the 0.9 beta's, which support list and union inputs.
0.8.3. I am going to upgrade cog to 0.9 beta. Thank you.😄
@peter65374 @yorickvP it didn't work for me...
Version: 0.9.0b9
TypeError: Unsupported input type typing.List for parameter `liked_images`. Supported input types are: str, int, float, bool, cog.File, cog.Path.
ⅹ Failed to get container status: exit status 1
TypeError: Unsupported input type list for parameter `liked_images`. Supported input types are: str, int, float, bool, cog.File, cog.Path.
ⅹ Failed to get container status: exit status 1
I'm also running into this, but I swear it was working yesterday...
This should work
❯ sudo curl -o /usr/local/bin/cog -L "https://github.com/replicate/cog/releases/download/v0.9.0-beta11/default.cog_darwin_arm64"
@jonhilgart22
sudo cog predict -i prompt='mona lisa eating ice cream' -i seed=4 -i [email protected] -i auto_depth=True -i ddim_steps=28
/usr/local/bin/cog: 1: Syntax error: "(" unexpected
That's weird. Looks like something installed wrongly. The official instructions are as follows:
sudo curl -o /usr/local/bin/cog -L "https://github.com/replicate/cog/releases/latest/download/cog_$(uname -s)_$(uname -m)"
sudo chmod +x /usr/local/bin/cog
Alternatively, try sudo rm /usr/local/bin/cog; brew install cog