Replicate Error Through Pydantic Validation

152 views Asked by At

I am trying to use blip's image captioning function using replicate Library in Python. Here's the code I took from the website.

import replicate
os.environ["REPLICATE_API_TOKEN"]="my_token_id"
output = replicate.run(
    "salesforce/blip:2e1dddc8621f72155f24cf2e0adbde548458d3cab9f00c0139eea840d0ac4746",
    input={"image": "my image file path", },
)
print(output)

Here's the error message I get

File "/Users/myuserid/anaconda3/lib/python3.7/site-packages/pydantic/main.py", line 164, in __init__
    __pydantic_self__.__pydantic_validator__.validate_python(data, self_instance=__pydantic_self__)
pydantic_core._pydantic_core.ValidationError: 3 validation errors for Prediction
output
  Field required [type=missing, input_value={'id': 'wph6e4jbcxdt7en5f...4jbcxdt7en5frf5gm6znq'}}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.4/v/missing
started_at
  Field required [type=missing, input_value={'id': 'wph6e4jbcxdt7en5f...4jbcxdt7en5frf5gm6znq'}}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.4/v/missing
completed_at
  Field required [type=missing, input_value={'id': 'wph6e4jbcxdt7en5f...4jbcxdt7en5frf5gm6znq'}}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.4/v/missing

Has anybody had this problem before? I am not sure what inputs I should change. I looked at Blip's outlined inputs and nothing is required really.

0

There are 0 answers