Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Error in Multiprocessing of the app on Windows #163

Open
sansyrox opened this issue Feb 20, 2022 · 2 comments · May be fixed by #804
Open

[BUG] Error in Multiprocessing of the app on Windows #163

sansyrox opened this issue Feb 20, 2022 · 2 comments · May be fixed by #804

Comments

@sansyrox
Copy link
Member

Probably related to #140

Description

The number of workers are 1
objc[18920]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
objc[18920]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.

Expected Behavior

This was giving an error when I was initializing a GPT 3 object.

Possible fix:

with multiprocessing.get_context("spawn").Pool() as pool:
    pool.map(annotate,img_urls)

[Optional] Additional Context

Sample Code

@app.get("/")
async def h(requests):
    engines = openai.Engine.list()

# print the first engine's id
    print(engines.data[0].id)

# create a completion
    completion = openai.Completion.create(engine="ada", prompt="Hello world")

# print the completion
    print(completion.choices[0].text)
    openai.Completion.create(
      engine="davinci",
      prompt="Make a list of astronomical observatories:"
    )

    return "Hello, world!"

@sansyrox
Copy link
Member Author

Finally have an access to a Windows machine. So, can check it out

@sansyrox sansyrox changed the title [BUG] Error in Multiprocessing of the app [BUG] Error in Multiprocessing of the app on Windows Aug 22, 2022
@sansyrox
Copy link
Member Author

#261

@sansyrox sansyrox pinned this issue Apr 22, 2024
@sansyrox sansyrox linked a pull request Apr 22, 2024 that will close this issue
4 tasks
@sansyrox sansyrox unpinned this issue Aug 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant