yethee / tiktoken-php

This is a port of the tiktoken
MIT License
92 stars 19 forks source link

能不能把EncoderProvider对象里面的vocab地址改成本地而不是去远程服务器下载 #2

Closed xiaojian520 closed 1 year ago

yethee commented 1 year ago

You can configure cache to reduce NET traffic.

  1. Via the environment variable TIKTOKEN_CACHE_DIR
  2. Programmatically:

    use Yethee\Tiktoken\EncoderProvider;
    
    $encProvider = new EncoderProvider();
    $encProvider->setVocabCache('/path/to/cache');
    
    // Using the provider
xiaojian520 commented 1 year ago

think you