How to run “openai migrate” in Space?

I think posted in a wrong group so i am reposting this question here, web admin please delete either inappropriate one.

I am deploying a super simple LLM webapp through huggingface’s spaces

but it throws me this error:

APIRemovedInV1: You tried to access openai.ChatCompletion, but this is no longer supported in openai>=1.0.0 - see the README at for the API. You can run `openai migrate` to automatically upgrade your codebase to use the 1.0.0 interface. Alternatively, you can pin your installation to the old version, e.g. `pip install openai==0.28` A detailed migration guide is available here:

I attempted to specify version 0.28 of openai in my requirements.txt file, but encountered an error indicating that this version does not exist.

Subsequently, I modified the version to 0.0.28, which appeared to resolve this particular issue. However, I was then faced with a different error. At this point, I considered using openai migrate, but I’m uncertain about how to proceed.

I also checked the discussion at v1.0.0 Migration Guide · openai/openai-python · Discussion #742 · GitHub for guidance, but couldn’t find information directly relevant to the issue I’m experiencing with huggingface spaces.

If anyone could provide assistance on how to address this, it would be greatly appreciated.

hi @Entz , I can’t access your private Space, please double check if you have
openai==0.28.0 on the requirements.txt doc and that version doesn’t conflict with any other package requirements.

1 Like

Amazing, it works now. I specified openai==0.28.0 in the requirement.txt file before. but it threw me another error. Anyway, it works now, thank you @radames !

1 Like

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.