Comments (2)
I'm getting the same error. Did you find out what was wrong?
from developer.
I solved the problem with KeyError: 'OPENAI_API_KEY' mentioned above by adding the API key directly to main_no_modal.py on line 26: openai.api_key = "paste here your api key"
next solution of the same problem could be also to install python-dotenv:
pip install python-dotenv
Anyway then I am getting another error in the main_no_modal.py:
Note: The user may choose to name the files differently or store them in a different directory.
Traceback (most recent call last):
File "C:\Github\developer\main_no_modal.py", line 230, in
main(prompt, directory, file)
File "C:\Github\developer\main_no_modal.py", line 135, in main
list_actual = ast.literal_eval(filepaths_string)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\boylucky\AppData\Local\Programs\Python\Python311\Lib\ast.py", line 64, in literal_eval
node_or_string = parse(node_or_string.lstrip(" \t"), mode='eval')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\boylucky\AppData\Local\Programs\Python\Python311\Lib\ast.py", line 50, in parse
return compile(source, filename, mode, flags,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1
I assume you want me to generate the filepaths for creating a python script that counts from 100 to 1. Here are the filepaths:
^^^^^^
SyntaxError: invalid syntax
Any help will be appreciated. By the way I am using the python virtual environments instead of modal. All the modules from requirements.txt were installed.
In the end I assigned to modal and then looks the smol-ai works ok. But with modal I get many errors when trying to run with GPT-4 API. Command used:
modal run main.py --prompt "Write a python script which will count from 100 to 1" --model=gpt-4
Traceback (most recent call last):
File "/pkg/modal/_container_entrypoint.py", line 330, in handle_input_exception
yield
File "/pkg/modal/_container_entrypoint.py", line 403, in call_function_sync
res = fun(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^
File "/root/main.py", line 55, in generate_response
response = openai.ChatCompletion.create(**params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/openai/api_resources/chat_completion.py", line 25, in create
return super().create(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 153, in create
response, _, api_key = requestor.request(
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/openai/api_requestor.py", line 230, in request
resp, got_stream = self._interpret_response(result, stream)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/openai/api_requestor.py", line 624, in _interpret_response
self._interpret_response_line(
File "/usr/local/lib/python3.11/site-packages/openai/api_requestor.py", line 687, in _interpret_response_line
raise self.handle_error_response(
openai.error.InvalidRequestError: The model: gpt-4
does not exist
When running without gpt-4 parameter then the smol-ai succeed.
Thanks in advance for help.
from developer.
Related Issues (20)
- Please add releases HOT 1
- No Module named 'openai' HOT 5
- args not defined error HOT 2
- stream_handler error: 'content' {} ←[0m ←[0m ←[0m ←[0m ←[0m ←[0m
- NameError: name 'args' is not defined HOT 3
- pip install modal-client error
- OpenAI key error HOT 4
- JavaScript files contain code fences
- Add a new feature - test and debug to create self-healing code
- Timeout issue
- Error: The system cannot find the file specified. HOT 1
- Can anyone fix the Basic Usate in Git Repo mode? HOT 1
- PyPI Package is Broken
- Run demo through pip package, no response, no output, no error reported, program automatically ends HOT 1
- Is there a way to bind with azure openai?
- Errors when running `poetry run python main.py --prompt "poetry prompt"`
- Feature Proposal: New feature proposal HOT 1
- Test
- how to use codellama instead of openai api? HOT 3
- can someone update this with a dockerfile for ubuntu 22.04 so we can run this? currently it doesnt work
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from developer.