-
Notifications
You must be signed in to change notification settings - Fork 387
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
Is upload_file thread safe? #327
Comments
Does this mean that this method does not support concurrency? |
the error desc:[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:2621) |
@jiupinjiandingshi, I tried running Prompting with media files tutorial and |
If I run it once, there is no problem, as follows: But if my interface receives two requests at the same time, this code may be called twice in the same time period. In this case, an error will be reported as follows: |
try to run |
Thanks, please reopen this if the problem comes back in a reproducible way. |
i tried upgrading the library as suggested by @sMx7d . But still getting errors
anyone else finding the same issue? |
@ronfromhp , uninstall and reinstall it. |
@sMx7d somehow its gone back to giving the ssl error these are the installed libraries: This is the same old error trace im getting:
|
Its stil a ssl error , sorry but i don't know anything in ssl or what it means . |
@jiupinjiandingshi can you reopen the issue? As currently I havent found a resolution which works |
sorry , i just reviewed the error and i saw |
as of my previous comment i was still getting the same ssl error even after updating genai @sMx7d |
Yeah, this error is reproducible, sorry I missed the follow ups here after the initial close. This script works fine: https://gist.github.com/MarkDaoust/dcd65b626bf4683860aa510b79bc225e But if I add an https://gist.github.com/MarkDaoust/73035a173d532f03c1a2c5aa49de9993
|
Upload file is one method that isn't auto-generated in the I added code client.py#L69-L123 to implement the API's This code is based on the discovery API, and I shouldn't be sharing those discovery instances between threads:
Thanks @jachor for pointing this out. So I think we just need to make Also related: #564 |
@MarkDaoust this is working for me with your suggestion for anyones reference |
@sumeet-desai, Nice. That looks right. Can you send a PR? |
@MarkDaoust I've raised it here |
Experiencing this too - excited for the update. |
hi any updates on this its a real bugger for prod apps. When will it be released? |
Description of the bug:
when I want use genai , I need to use this method in an interface request, but when I put "genai.upload_file(path=path,display_name=file)" into the interface method, it will report an error SLL_ERROR
@app.route("/xxx",method=["GET"]) def upload_video(): output_frame_folder = requests.output_frame_folder time.sleep(1.0) lists = [] try: for file in os.listdir(f"{output_frame_folder}"): path = os.path.join(f"{output_frame_folder}", file) sample_file = genai.upload_file(path=path,display_name=file)
Actual vs expected behavior:
No response
Any other information you'd like to share?
No response
The text was updated successfully, but these errors were encountered: