Skip to content
Discussion options

You must be logged in to vote

when I copied and pasted your code my ide transformed your model into:

class FashionSwapFormData(BaseModel):
    PersonImage: Optional[UploadFile] = (File(default=None),)
    PersonUrl: Optional[str] = (Form(default=None),)

    ClothesImage: Optional[UploadFile] = (File(default=None),)
    ClothesUrl: Optional[str] = (Form(default=None),)

I had the same error as you

But if you remove the comma

class FashionSwapFormData(BaseModel):
    PersonImage: Optional[UploadFile] = File(default=None)
    PersonUrl: Optional[str] = Form(default=None)
    ClothesImage: Optional[UploadFile] = File(default=None)
    ClothesUrl: Optional[str] = Form(default=None)

every thing works fine

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Kludex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question or problem
2 participants