Some python files give me this error -
OpenAI API error occurred: Error code: 400 - {‘error’: {‘message’: ‘Invalid file format text/x-objective-c. Supported formats: “c”, “cpp”, “css”, “csv”, “docx”, “gif”, “html”, “java”, “jpeg”, “jpg”, “js”, “json”, “md”, “pdf”, “php”, “png”, “pptx”, “py”, “rb”, “tar”, “tex”, “ts”, “txt”, “webp”, “xlsx”, “xml”, “zip”’, ‘type’: ‘invalid_request_error’, ‘param’: None, ‘code’: None}}
Jun 28 16:27:39 ip-172-31-0-5 web[40252]: 2024-06-28 16:27:39,103 - An error occurred: OpenAI API error: Error code: 400 - {‘error’: {‘message’: ‘Invalid file format text/x-objective-c. Supported formats: “c”, “cpp”, “css”, “csv”, “docx”, “gif”, “html”, “java”, “jpeg”, “jpg”, “js”, “json”, “md”, “pdf”, “php”, “png”, “pptx”, “py”, “rb”, “tar”, “tex”, “ts”, “txt”, “webp”, “xlsx”, “xml”, “zip”’, ‘type’: ‘invalid_request_error’, ‘param’: None, ‘code’: None}}
And others are just fine.
I know that the file upload has been squirly - but wondering if there is a workaround or a fix - I’m certain that the mime type of the file is correct, so it makes me feel like OAI does something to determine file type based on the content and that there might be a simple workaround.
Ideas gratefully accepted