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

Not working in deno deploy #3

Open
deepak-coding-art opened this issue Mar 18, 2023 · 4 comments
Open

Not working in deno deploy #3

deepak-coding-art opened this issue Mar 18, 2023 · 4 comments

Comments

@deepak-coding-art
Copy link

I am trying to load it in deno with the help of esm.sh but it is giving error:

error: Uncaught Error: createRequire only supports 'file://' URLs for the 'filename' parameter. Received 'https://esm.sh/v111/tiktoken-node@0.0.4/deno/tiktoken-node.js'
          throw new Error(
                ^
    at createRequire (https://deno.land/std@0.177.0/node/module.ts:690:17)
    at https://esm.sh/v111/tiktoken-node@0.0.4/deno/tiktoken-node.js:2:185

import statement

import tiktoken from "https://esm.sh/tiktoken-node@0.0.4";
@ceifa
Copy link
Owner

ceifa commented Mar 18, 2023

Looks like the createRequire function have a different behavior on deno. Anyway using compat mode fixes it:

import tiktoken from "npm:tiktoken-node";

@deepak-coding-art
Copy link
Author

I am using the supabase edge functions and the npm packages are not available in that

Did this package support the cl100k_base encoding for the gpt-turbo-3.5 model

@waptik
Copy link

waptik commented Mar 25, 2023

I am trying to load it in deno with the help of esm.sh but it is giving error:

error: Uncaught Error: createRequire only supports 'file://' URLs for the 'filename' parameter. Received 'https://esm.sh/v111/tiktoken-node@0.0.4/deno/tiktoken-node.js'
          throw new Error(
                ^
    at createRequire (https://deno.land/std@0.177.0/node/module.ts:690:17)
    at https://esm.sh/v111/tiktoken-node@0.0.4/deno/tiktoken-node.js:2:185

import statement

import tiktoken from "https://esm.sh/tiktoken-node@0.0.4";

Did you try using skypack cdn instead of esm.sh? Sometimes using npm packages with skypack.dev works where esm fails

@liamcharmer
Copy link

I am using the supabase edge functions and the npm packages are not available in that

Did this package support the cl100k_base encoding for the gpt-turbo-3.5 model

Did you get this working in the end?

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

No branches or pull requests

4 participants