Closed haruiz closed 1 month ago
@haruiz, I just tried running the counting tokens tutorial with generative-ai-python 0.5.4
and model.count_tokens
is able to count the numbers of tokens successfully for audio files. Please try out the tutorial and let us know if you face any issues and share a reproducible colab gist with us to reproduce the issue on our end. Thank you!
Hi @singhniraj08, thanks for your response. After updating the library 'generative-ai-python', it works perfectly! Thank you!
Description of the bug:
After uploading a file using the file API and calling the
count_tokens
functions, I get the following error.google.api_core.exceptions.PermissionDenied: 403 You do not have permission to access the File 8lqhztqcd6g1 or it may not exist
Here is my code:
Additional info: For some reason, if I comment the
model.count_tokens
call line, and run the following code, it works:Actual vs expected behavior:
Return the number of tokens as shown in the notebook: https://github.com/google-gemini/cookbook/blob/main/quickstarts/Counting_Tokens.ipynb
Any other information you'd like to share?
No response