diff --git a/edenai_apis/apis/affinda/client.py b/edenai_apis/apis/affinda/client.py index 144d0bc8..f6e94ecb 100644 --- a/edenai_apis/apis/affinda/client.py +++ b/edenai_apis/apis/affinda/client.py @@ -483,9 +483,7 @@ def create_document( files: Optional[Dict[str, BufferedReader]] = None - if file.type == "url": - payload["url"] = file.file - elif file.type == "file": + if file.type == "file": with open(file.file, "rb") as f: files = {"file": f} return Document( @@ -498,6 +496,7 @@ def create_document( ) ) else: + payload["url"] = file.file return Document( **self.__requests( method=HTTPMethod.POST,