Not working in deno deploy
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/[email protected]/deno/tiktoken-node.js'
throw new Error(
^
at createRequire (https://deno.land/[email protected]/node/module.ts:690:17)
at https://esm.sh/v111/[email protected]/deno/tiktoken-node.js:2:185
import statement
import tiktoken from "https://esm.sh/[email protected]";
Looks like the createRequire function have a different behavior on deno. Anyway using compat mode fixes it:
import tiktoken from "npm:tiktoken-node";
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
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/[email protected]/deno/tiktoken-node.js' throw new Error( ^ at createRequire (https://deno.land/[email protected]/node/module.ts:690:17) at https://esm.sh/v111/[email protected]/deno/tiktoken-node.js:2:185import statement
import tiktoken from "https://esm.sh/[email protected]";
Did you try using skypack cdn instead of esm.sh? Sometimes using npm packages with skypack.dev works where esm fails
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?