tiktoken icon indicating copy to clipboard operation
tiktoken copied to clipboard

fix pycache folder being added instead of encoding info files

Open dheerajiiitv opened this issue 1 year ago • 9 comments

Fix #61

CC: @hauntsaninja

dheerajiiitv avatar Jun 23 '23 10:06 dheerajiiitv

@hauntsaninja please review

dheerajiiitv avatar Jul 03 '23 05:07 dheerajiiitv

Any update on this @hauntsaninja?

rishabh-sagar-20 avatar Dec 28 '23 10:12 rishabh-sagar-20

@dheerajiiitv did you test this on aws lambda? I tried your changes in lambda with no success, same issue persists.

AlexanderCollins avatar Jan 21 '24 06:01 AlexanderCollins

@AlexanderCollins I did not test it on AWS lambda. Can you check and debug the values in the filter list? And also how did you build the package with my changes?

dheerajiiitv avatar Jan 22 '24 09:01 dheerajiiitv

@dheerajiiitv I get error in lambda while deploying through zappa

  File "/var/task/summaryserver.py", line 13, in <module>
    encoding = tiktoken.get_encoding("cl100k_base")
  File "/var/task/tiktoken/registry.py", line 64, in get_encoding
    _find_constructors()
  File "/var/task/tiktoken/registry.py", line 44, in _find_constructors

azmathr avatar Feb 15 '24 13:02 azmathr

Hey! Although this is not a solution for tiktoken, you can work around this error by adding the following to your zappa_settings.json file:

"exclude": [
    "pycache",
    "__pycache__"
]

Successfully tested on AWS Lambda.

mpinta avatar Feb 20 '24 09:02 mpinta

Thanks but that gives this error: Runtime.ImportModuleError: Unable to import module 'handler': No module named 'werkzeug' and Runtime.ImportModuleError: Unable to import module 'handler': attempted relative import with no known parent package

azmathr avatar Feb 21 '24 08:02 azmathr

I deleted pycache file from seite packages main folder and tiktoken folders and it worked!

azmathr avatar Feb 21 '24 08:02 azmathr

Hey @hauntsaninja, is there any update on this? When are we merging this?

rishabh-sagar-20 avatar Apr 05 '24 13:04 rishabh-sagar-20