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

Permission denied #75

Closed
realliyifei opened this issue Mar 22, 2023 · 6 comments
Closed

Permission denied #75

realliyifei opened this issue Mar 22, 2023 · 6 comments

Comments

@realliyifei
Copy link

I cannot use tiktoken in python:

Input encoding = tiktoken.get_encoding('cl100k_base'),

it gives the error PermissionError: [Errno 13] Permission denied: '/tmp/data-gym-cache/9b5ad71b2ce5302211f9c61530b329a4922fc6a4.2749b823-646b-45d7-9fcf-11414469d900.tmp'

But I can use it in my colab.

@hauntsaninja
Copy link
Collaborator

Try setting the environment variable TIKTOKEN_CACHE_DIR=""

@hauntsaninja hauntsaninja closed this as not planned Won't fix, can't repro, duplicate, stale Mar 28, 2023
@balajivenkatesh
Copy link

Is there another way to fix the same issue? I do not have access to set an environment variable.

@subhojit-me
Copy link

getting the same issue when deployed a django application with langchain package in IIS using HttpPlatformModule, can anyone let me know how to resolve this?

@TheNamesAlex
Copy link

If you are using this in a kubernetes environment, you can do the following:

  1. make an environment variable for tiktoken
    TIKTOKEN_CACHE_DIR = "desired_path_to_tmp"

  2. Add the directory to your dockerfile and make the user owner of that directory
    RUN mkdir /desired_path_to_tmp && chown -R 2:2 /desired_path_to_tmp

@wookayin
Copy link

You will get this error in a multi-user system. When some other users have already created the cache dir /tmp/data-gym-cache, they own the directory, and you don't have the permission. It's a bad idea to hard-code the temporary directory.

@hauntsaninja
Copy link
Collaborator

I've pushed a change that will swallow the PermissionError in the default case. This will be released in tiktoken 0.5.2

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.

6 participants