openai-cookbook
openai-cookbook copied to clipboard
Error: using nextjs-with-flask-server app is showing error
I have installed the Server as per the readme file and run a client on the terminal.
the local host appeared and uploaded a doc, when trying to get an answer its displaying the below error.
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
event - compiled client and server successfully in 1182 ms (166 modules)
wait - compiling...
event - compiled successfully in 100 ms (133 modules)
wait - compiling / (client and server)...
event - compiled client and server successfully in 521 ms (757 modules)
INFO:werkzeug: * Debugger PIN: 105-174-659
INFO:werkzeug:127.0.0.1 - - [25/Feb/2023 11:56:49] "POST /process_file HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [25/Feb/2023 11:56:51] "OPTIONS /answer_question HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [25/Feb/2023 11:56:54] "POST /answer_question HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [25/Feb/2023 11:57:14] "POST /process_file HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [25/Feb/2023 11:57:24] "OPTIONS /answer_question HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [25/Feb/2023 11:57:27] "POST /answer_question HTTP/1.1" 200 -
I get a similar error when trying to get an answer from the successfully uploaded document.

got this aswell;
Error is triggered only when i upload a second file and ask a question; I can silence the error and get the system running by checking whether the parameters of the function existed; this results in unstable behavior
spent a short amount of time modifying the src/components/ files and made some changes which seemed to make an improvement but was unstable;
How did you get it to upload. Mine doesn't upload, it gives the error POST http://localhost:8080/process_file net::ERR_CONNECTION_REFUSED
Mine doesn't upload either!

Hey @Ayo-faks and @troublesprouter are you running the server in a separate terminal tab, and did you add your own details to server/config.py? I also just pushed a change to the server initializing script that could help.
same problem here. it just does not connect but the code seems correct. i even disabled my firewall but same problem. I wonder what it could be.
Hey @Ayo-faks and @troublesprouter are you running the server in a separate terminal tab, and did you add your own details to server/config.py? I also just pushed a change to the server initializing script that could help.
Hello @isafulf , I still get the same error. Wonder why it's different for me. And yes, they are opened on different terminals. Can you test it out on codespaces or gitpod, maybe there is a port forwarding issue.
thanks
Hey @Ayo-faks and @troublesprouter are you running the server in a separate terminal tab, and did you add your own details to server/config.py? I also just pushed a change to the server initializing script that could help.
I tried Linux now. It now attempts uploading but fails with "error processing file: AxiosError: Request aborted" in the console.
Any ideas how to make it work?
Yes, terminals are different.
Update: it worked on Linux. I don't know why.
Update: it worked on Linux. I don't know why.
Are you running it locally on your system? I have still not got it to work. any help, anyone!
Update: it worked on Linux. I don't know why.
Are you running it locally on your system? I have still not got it to work. any help, anyone!
Yes, it ran locally. Try to find all places to add the API keys and use 3 terminal windows just to be safe.
Any advice on how to host it publicly with Vercel or something else? What's the simplest way?
I tried running vercel from the root directory but got a 404 error. Not sure what changes have to be made.
I ran into this same problem, but I think it had to do with being rate limited. I was on the free trial and running too many requests per minute. I started waiting two-three minutes between questions and was able to get around this issue.
Related documentation: https://github.com/openai/openai-cookbook/blob/main/examples/How_to_handle_rate_limits.ipynb
Update: it worked on Linux. I don't know why.
Are you running it locally on your system? I have still not got it to work. any help, anyone!
Yes, it ran locally. Try to find all places to add the API keys and use 3 terminal windows just to be safe.
Any advice on how to host it publicly with Vercel or something else? What's the simplest way?
I tried running
vercelfrom the root directory but got a 404 error. Not sure what changes have to be made.
My plan was to deploy the flask app as a container and then host the Nextjs app on vercel.
Do you remember the steps you took to make it work, what changed , where were you running it before? We have exactly the same problem.
I tried mac without success. Don’t know the cause.
I set an openai api key inside the yaml config file too. Not sure that was there before.
Changed the start script command to python3 from python.
Hope that helps.
Is Vercel ok with both including flask or only with the nextjs part?
On Tue, 21 Mar 2023 at 16:28, faksonbaba @.***> wrote:
Update: it worked on Linux. I don't know why.
Are you running it locally on your system? I have still not got it to work. any help, anyone!
Yes, it ran locally. Try to find all places to add the API keys and use 3 terminal windows just to be safe.
Any advice on how to host it publicly with Vercel or something else? What's the simplest way?
I tried running vercel from the root directory but got a 404 error. Not sure what changes have to be made.
My plan was to deploy the flask app as a container and then host the Nextjs app on vercel.
Do you remember the steps you took to make it work, what changed , where were you running it before? We have exactly the same problem.
— Reply to this email directly, view it on GitHub https://github.com/openai/openai-cookbook/issues/159#issuecomment-1478172286, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADGDEVWUB5K7YQV7HXKTXO3W5HJJLANCNFSM6AAAAAAVHVPTQI . You are receiving this because you were mentioned.Message ID: @.***>
I tried mac without success. Don’t know the cause. I set an openai api key inside the yaml config file too. Not sure that was there before. Changed the start script command to python3 from python. Hope that helps. Is Vercel ok with both including flask or only with the nextjs part? … On Tue, 21 Mar 2023 at 16:28, faksonbaba @.> wrote: Update: it worked on Linux. I don't know why. Are you running it locally on your system? I have still not got it to work. any help, anyone! Yes, it ran locally. Try to find all places to add the API keys and use 3 terminal windows just to be safe. Any advice on how to host it publicly with Vercel or something else? What's the simplest way? I tried running vercel from the root directory but got a 404 error. Not sure what changes have to be made. My plan was to deploy the flask app as a container and then host the Nextjs app on vercel. Do you remember the steps you took to make it work, what changed , where were you running it before? We have exactly the same problem. — Reply to this email directly, view it on GitHub <#159 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADGDEVWUB5K7YQV7HXKTXO3W5HJJLANCNFSM6AAAAAAVHVPTQI . You are receiving this because you were mentioned.Message ID: @.>
For me it is easier to wrap my head around deploying it as a container.
I am almost giving up on this repo and @isafulf does not seem intrested
If the maintainer sees this please add a quick guide to deploy with Vercel.
On Tue, 21 Mar 2023 at 18:15, faksonbaba @.***> wrote:
I tried mac without success. Don’t know the cause. I set an openai api key inside the yaml config file too. Not sure that was there before. Changed the start script command to python3 from python. Hope that helps. Is Vercel ok with both including flask or only with the nextjs part? … <#m_-1108222687762179029_> On Tue, 21 Mar 2023 at 16:28, faksonbaba @.> wrote: Update: it worked on Linux. I don't know why. Are you running it locally on your system? I have still not got it to work. any help, anyone! Yes, it ran locally. Try to find all places to add the API keys and use 3 terminal windows just to be safe. Any advice on how to host it publicly with Vercel or something else? What's the simplest way? I tried running vercel from the root directory but got a 404 error. Not sure what changes have to be made. My plan was to deploy the flask app as a container and then host the Nextjs app on vercel. Do you remember the steps you took to make it work, what changed , where were you running it before? We have exactly the same problem. — Reply to this email directly, view it on GitHub <#159 (comment) https://github.com/openai/openai-cookbook/issues/159#issuecomment-1478172286>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADGDEVWUB5K7YQV7HXKTXO3W5HJJLANCNFSM6AAAAAAVHVPTQI https://github.com/notifications/unsubscribe-auth/ADGDEVWUB5K7YQV7HXKTXO3W5HJJLANCNFSM6AAAAAAVHVPTQI . You are receiving this because you were mentioned.Message ID: @.>
For me it is easier to wrap my head around deploying it as a container.
I am almost giving up on this repo and @isafulf https://github.com/isafulf does not seem intrested
— Reply to this email directly, view it on GitHub https://github.com/openai/openai-cookbook/issues/159#issuecomment-1478377997, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADGDEVWREZQZHUMTH2GND23W5HV5FANCNFSM6AAAAAAVHVPTQI . You are receiving this because you were mentioned.Message ID: @.***>
I get a similar error when trying to get an answer from the successfully uploaded document.
Im curious if anyone has gotten around this? When uploading larger document or more than one document it breaks here.
Has anybody gotten this to work? I am trying to run this on Linux, but am getting an Axios ERR_CONNECTION_REFUSED when trying to upload a document. How do I get around this error? Also, @isafulf mentioned editing the server/config.py file with our own information. What needs to be edited in this file?