[Python] how to use tiktoken in offline mode computer

Discussão em 'Python' iniciado por Stack, Fevereiro 7, 2025.

  1. Stack

    Stack Membro Participativo

    import tiktoken

    tokenizer = tiktoken.get_encoding("cl100k_base") tokenizer = tiktoken.encoding_for_model("gpt-3.5-turbo")

    text = "Hello, nice to meet you"

    tokenizer.encode(text)



    This keeps showing error called requests.exceptions.SSLError. Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1002)')) ... like this.

    I wanted to run this code to see the number of tokens. But it keeps showing error as I mentioned earlier. What am I missing for the code?

    Continue reading...

Compartilhe esta Página