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

Usage of gpt-3.5-turbo model #19

Closed
kiran-brahma opened this issue May 4, 2023 · 15 comments · Fixed by #34
Closed

Usage of gpt-3.5-turbo model #19

kiran-brahma opened this issue May 4, 2023 · 15 comments · Fixed by #34
Labels
documentation Improvements or additions to documentation

Comments

@kiran-brahma
Copy link

Hello,

I was trying to see if I can modify the model from text-davinci-003 to gpt-3.5-turbo in vector search but noticed that the app doesn't work anymore and keep getting search errors.
Is it any error from my end or some other issue that I am unaware of

@kiran-brahma kiran-brahma added the documentation Improvements or additions to documentation label May 4, 2023
@gregnr
Copy link
Contributor

gregnr commented May 4, 2023

Hey @kiran-brahma - agreed we should update this with the newer chat-based models. In the mean time, you can see how we have done this on the official Supabase website here:

https://github.com/supabase/supabase/blob/e524c30dd88af8bf5054a7f296eac8bd9d73affb/supabase/functions/ai-docs/index.ts

@kiran-brahma
Copy link
Author

Thanks @gregnr. Will see and try to understand if same can be done for my code base. Any expected timelines for a similar implementation for the current template.

@kiran-brahma
Copy link
Author

kiran-brahma commented May 8, 2023

Hello @gregnr I tried to replicate the code shared by you but I keep getting the error
Type error: Cannot find module 'import { serve } from 'https://deno.land/std@0.170.0/http/server.ts'' or its corresponding type declarations.

1 | import { serve } from 'https://deno.land/std@0.170.0/http/server.ts'';
| ^
2 | import 'xhr@0.2.1/mod.ts'
3 | import { createClient } from '@supabase/supabase-js'
4 | import { codeBlock, oneLine } from 'common-tags'
 ELIFECYCLE  Command failed with exit code 1.
 Any idea on how to resolve as I managed to install local packages for others but unable for Deno

@gregnr
Copy link
Contributor

gregnr commented May 8, 2023

Hey @kiran-brahma, confirming your error was copied over correctly? I see a double import:

1 | import { serve } from 'import { serve } from 'https://deno.land/std@0.170.0/http/server.ts'';

@kiran-brahma
Copy link
Author

There was an error in the code I pasted. There is no double import and just a single one

@gregnr
Copy link
Contributor

gregnr commented May 9, 2023

Is the error coming from your IDE or when you run the edge function? If IDE & VSCode, confirming you have the official Deno extension installed and the dependency has been cached?

@kiran-brahma
Copy link
Author

I am getting the error when deploying it on vercel.

Including the error message I got after making another attempt today

Attention: Next.js now collects completely anonymous telemetry regarding usage.

This information is used to shape Next.js' roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://nextjs.org/telemetry
 

  • info Linting and checking validity of types...
    Failed to compile.
     
    ./pages/api/vector-search.ts:1:23
    Type error: Cannot find module 'https://deno.land/std@0.186.0/http/server.ts' or its corresponding type declarations.
     

1 | import { serve } from "https://deno.land/std@0.186.0/http/server.ts";
| ^
2 | import 'x/xhr@0.2.1/mod.ts'
3 | import { createClient } from '@supabase/supabase-js'
4 | import { codeBlock, oneLine } from 'common-tags'
ELIFECYCLE  Command failed with exit code 1.
Error: Command "pnpm run build" exited with 1
Deployment completed
BUILD_UTILS_SPAWN_1: Command "pnpm run build" exited with 1

@gregnr
Copy link
Contributor

gregnr commented May 10, 2023

Based on the path ./pages/api/vector-search.ts, it looks like you are placing your edge function in a Next.js serverless function instead of a Supabase edge function. If you are planning to use Supabase edge functions, you will need to place your edge function under the ./supabase/functions folder as described in this guide:
https://supabase.com/docs/guides/functions/quickstart

Supabase uses Deno for its edge runtime while Next.js uses Node.js (or their custom runtime for edge). This is most likely why you are getting the import error as imports work slightly different in Deno.

@kiran-brahma
Copy link
Author

I shifted the edge functions to supabase and when I am trying to deploy the same on supabase I am getting the following error

Version 1.30.3 is already installed
Bundling ai-docs
Error: Error bundling function: exit status 1
file:///src/import_map.json
file:///src/index.ts
file:///common/errors
file:///common/tokenizer
error: Uncaught (in promise) Error: NotFound: No such file or directory (os error 2)
const ret = new Error(getStringFromWasm0(arg0, arg1));
^
at __wbg_new_8d2af00bc1e329ee (https://deno.land/x/eszip@v0.35.0/eszip_wasm.generated.js:513:19)
at (https://deno.land/x/eszip@v0.35.0/eszip_wasm_bg.wasm:1:1559899)
at (https://deno.land/x/eszip@v0.35.0/eszip_wasm_bg.wasm:1:1398157)
at (https://deno.land/x/eszip@v0.35.0/eszip_wasm_bg.wasm:1:1895031)
at __wbg_adapter_40 (https://deno.land/x/eszip@v0.35.0/eszip_wasm.generated.js:229:6)
at real (https://deno.land/x/eszip@v0.35.0/eszip_wasm.generated.js:213:14)

@thorwebdev
Copy link
Contributor

@kiran-brahma can you please update your Supabase CLI version (e.g. brew upgrade supabase) and try again?

@kiran-brahma
Copy link
Author

hello @thorwebdev
Same issue persists even after the update

@thorwebdev
Copy link
Contributor

What does supabase --version output for you? Maybe there's a caching issue. Might have to run brew update first and the brew upgrade supabase.

@gregnr
Copy link
Contributor

gregnr commented May 12, 2023

If brew/scoop isn't getting you the latest version, you can also try the NPM approach as described here:
https://supabase.com/docs/guides/cli

@musashi-garami
Copy link
Contributor

Really would love this template to be upgraded to gpt-3.5-turbo model!! That would be super cool.

@chartpath
Copy link
Contributor

See my PR #34 which is what worked for me.

@gregnr gregnr closed this as completed in #34 Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants