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

Error when uploading file with gemini_1_5_pro_1m #147

Open
joja16 opened this issue Apr 28, 2024 · 1 comment
Open

Error when uploading file with gemini_1_5_pro_1m #147

joja16 opened this issue Apr 28, 2024 · 1 comment

Comments

@joja16
Copy link

joja16 commented Apr 28, 2024

I tried uploading the file and using gemini_1_5_pro_1m but both failed.
I always get the error message "Close Error: I/O operation on closed file"
Do you have any way I can perform other functions similar to gemini_1_5_pro_1m?

image

@sunnysktsang
Copy link
Contributor

Hello @joja16,

Thank you for reporting this issue with the gemini_1_5_pro_1m model's file handling. I have also encountered this problem and have developed a fix that addresses the "Close Error: I/O operation on closed file" error.

I've submitted a pull request that improves the file handling logic within the generate_file function to ensure that files are managed properly throughout their lifecycle. This fix should resolve the error you are experiencing.

Pull Request Details:

I'd appreciate it if the maintainer could review the pull request at their earliest convenience. This change might also benefit others facing similar issues.

For a temporary workaround, you can manually manage the file opening and closing processes in your code, ensuring that file streams are not closed prematurely until all operations are complete. However, the pull request provides a more robust and permanent solution.

Best regards,
Sunny

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

No branches or pull requests

2 participants