You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to follow your instructions, I went into the backend folder and tried poetry install.
❯ echo "OPENAI_API_KEY=sk-aaa...xxx" > .env
❯ poetry install
Creating virtualenv backend-dR2C48Xf-py3.11 in /home/antouank/.cache/pypoetry/virtualenvs
Installing dependencies from lock file
Package operations: 20 installs, 0 updates, 0 removals
• Installing certifi (2023.7.22)
• Installing h11 (0.14.0)
• Installing idna (3.4)
• Installing sniffio (1.3.0)
• Installing anyio (3.7.1)
• Installing httpcore (1.0.2)
• Installing typing-extensions (4.8.0)
• Installing click (8.1.7)
• Installing distro (1.8.0)
• Installing httpx (0.25.1)
• Installing pydantic (1.10.13)
• Installing soupsieve (2.5)
• Installing starlette (0.27.0)
• Installing tqdm (4.66.1)
• Installing beautifulsoup4 (4.12.2)
• Installing fastapi (0.95.2)
• Installing openai (1.2.4)
• Installing python-dotenv (1.0.0)
• Installing uvicorn (0.24.0.post1)
• Installing websockets (12.0)
Installing the current project: backend (0.1.0)
The current project could not be installed: [Errno 2] No such file or directory: '/home/antouank/_REPOS_/screenshot-to-code/backend/README.md'
If you do not want to install the current project use --no-root
I added a README but no difference really.
I also tried running it at the root folder as well, again it throws an error.
❯ touch README.md
❯ poetry install
Installing dependencies from lock file
No dependencies to install or update
Installing the current project: backend (0.1.0)
The current project could not be installed: No file/folder found for package backend
If you do not want to install the current project use --no-root
❯ cd ..
❯ poetry install
Poetry could not find a pyproject.toml file in /home/antouank/_REPOS_/screenshot-to-code or its parents
❯ poetry install
Installing dependencies from lock file
No dependencies to install or update
Installing the current project: backend (0.1.0)
The current project could not be installed: No file/folder found for package backend
If you do not want to install the current project use --no-root
❯ which poetry
/home/antouank/_REPOS_/screenshot-to-code/backend/venv/bin/poetry
❯ poetry install
Installing dependencies from lock file
No dependencies to install or update
Installing the current project: backend (0.1.0)
The current project could not be installed: [Errno 2] No such file or directory: '/<some-path>/screenshot-to-code/backend/README.md'
If you do not want to install the current project use --no-root
I have installed poetry. It doesn't look like the issue is resolved by installing poetry.
What do you recommend? What can I try? Do you need some logs / command output?
there's no README inside backend.
I added an empty one, and still there was an error ( it's in the logs )
I pulled and tried again. same error
❯ poetry install
Installing dependencies from lock file
No dependencies to install or update
Installing the current project: backend (0.1.0)
The current project could not be installed: No file/folder found for package backend
If you do not want to install the current project use --no-root
❯ ls
total 84K
drwxr-xr-x 3 antouank 4.0K Nov 16 16:03 .
drwxr-xr-x 5 antouank 4.0K Nov 16 16:03 ..
-rw-r--r-- 1 antouank 67 Nov 16 09:21 .env
-rw-r--r-- 1 antouank 2.7K Nov 16 09:19 .gitignore
-rw-r--r-- 1 antouank 3.2K Nov 16 09:19 image_generation.py
-rw-r--r-- 1 antouank 857 Nov 16 09:19 llm.py
-rw-r--r-- 1 antouank 3.0K Nov 16 16:03 main.py
-rw-r--r-- 1 antouank 7.1K Nov 16 09:19 mock.py
-rw-r--r-- 1 antouank 31K Nov 16 09:19 poetry.lock
-rw-r--r-- 1 antouank 2.1K Nov 16 09:19 prompts.py
-rw-r--r-- 1 antouank 397 Nov 16 16:03 pyproject.toml
-rw-r--r-- 1 antouank 788 Nov 16 09:19 utils.py
drwxr-xr-x 5 antouank 4.0K Nov 16 10:10 venv
~/_REPOS_/screenshot-to-code/backend on main ·········································· backend at 16:03:34
❯
have you tried cloning the repo on a new machine and running it?
or maybe try in a python docker container. so you can see what dependencies people need to run it.
Yeah, I know that the project works.
It's just the setup step.
Could be that it's people that have a python setup on their machine?
( I'm not a python dev, so maybe I'm missing something python related )
cd backend => OK
echo "OPENAI_API_KEY=sk-your-key" > .env => OK
poetry install => OK
poetry shell => OK
poetry run uvicorn main:app --reload --port 7001 => Not working
I'm not familiar with Python code, so I tried to follow the instructions, but when I ran the final command to run the backend project, I encountered the following error. How should I fix this issue? Can someone please help me? :(
poetry run uvicorn main:app --reload --port 7001
INFO: Will watch for changes in these directories: ['D:\Practice Projects\screenshot-to-code\backend']
INFO: Uvicorn running on http://127.0.0.1:7001 (Press CTRL+C to quit)
INFO: Started reloader process [16448] using StatReload
Process SpawnProcess-1:
Traceback (most recent call last):
File "C:\Users\ducvi\AppData\Local\Programs\Python\Python312\Lib\multiprocessing\process.py", line 314, in _bootstrap
self.run()
File "C:\Users\ducvi\AppData\Local\Programs\Python\Python312\Lib\multiprocessing\process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\uvicorn_subprocess.py", line 76, in subprocess_started
target(sockets=sockets)
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\uvicorn\server.py", line 61, in run
return asyncio.run(self.serve(sockets=sockets))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ducvi\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 194, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "C:\Users\ducvi\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 118, in run
return self.loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ducvi\AppData\Local\Programs\Python\Python312\Lib\asyncio\base_events.py", line 664, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\uvicorn\server.py", line 68, in serve
config.load()
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\uvicorn\config.py", line 467, in load
self.loaded_app = import_from_string(self.app)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\uvicorn\importer.py", line 21, in import_from_string
module = importlib.import_module(module_str)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ducvi\AppData\Local\Programs\Python\Python312\Lib\importlib_init.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1381, in _gcd_import
File "", line 1354, in _find_and_load
File "", line 1325, in _find_and_load_unlocked
File "", line 929, in _load_unlocked
File "", line 994, in exec_module
File "", line 488, in _call_with_frames_removed
File "D:\Practice Projects\screenshot-to-code\backend\main.py", line 4, in
load_dotenv()
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\main.py", line 346, in load_dotenv
return dotenv.set_as_environment_variables()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\main.py", line 91, in set_as_environment_variables
if not self.dict():
^^^^^^^^^^^
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\main.py", line 75, in dict
self._dict = OrderedDict(resolve_variables(raw_values, override=self.override))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\main.py", line 233, in resolve_variables
for (name, value) in values:
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\main.py", line 83, in parse
for mapping in with_warn_for_invalid_lines(parse_stream(stream)):
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\main.py", line 25, in with_warn_for_invalid_lines
for mapping in mappings:
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\parser.py", line 173, in parse_stream
reader = Reader(stream)
^^^^^^^^^^^^^^
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\parser.py", line 64, in init
self.string = stream.read()
^^^^^^^^^^^^^
File "", line 322, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
cd backend => OK echo "OPENAI_API_KEY=sk-your-key" > .env => OK poetry install => OK poetry shell => OK poetry run uvicorn main:app --reload --port 7001 => Not working
I'm not familiar with Python code, so I tried to follow the instructions, but when I ran the final command to run the backend project, I encountered the following error. How should I fix this issue? Can someone please help me? :(
poetry run uvicorn main:app --reload --port 7001 INFO: Will watch for changes in these directories: ['D:\Practice Projects\screenshot-to-code\backend'] INFO: Uvicorn running on http://127.0.0.1:7001 (Press CTRL+C to quit) INFO: Started reloader process [16448] using StatReload Process SpawnProcess-1: Traceback (most recent call last): File "C:\Users\ducvi\AppData\Local\Programs\Python\Python312\Lib\multiprocessing\process.py", line 314, in _bootstrap self.run() File "C:\Users\ducvi\AppData\Local\Programs\Python\Python312\Lib\multiprocessing\process.py", line 108, in run self._target(*self._args, **self.kwargs) File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\uvicorn_subprocess.py", line 76, in subprocess_started target(sockets=sockets) File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\uvicorn\server.py", line 61, in run return asyncio.run(self.serve(sockets=sockets)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ducvi\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 194, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "C:\Users\ducvi\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 118, in run return self.loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ducvi\AppData\Local\Programs\Python\Python312\Lib\asyncio\base_events.py", line 664, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\uvicorn\server.py", line 68, in serve config.load() File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\uvicorn\config.py", line 467, in load self.loaded_app = import_from_string(self.app) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\uvicorn\importer.py", line 21, in import_from_string module = importlib.import_module(module_str) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ducvi\AppData\Local\Programs\Python\Python312\Lib\importlib__init.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1381, in _gcd_import File "", line 1354, in _find_and_load File "", line 1325, in _find_and_load_unlocked File "", line 929, in _load_unlocked File "", line 994, in exec_module File "", line 488, in _call_with_frames_removed File "D:\Practice Projects\screenshot-to-code\backend\main.py", line 4, in load_dotenv() File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\main.py", line 346, in load_dotenv return dotenv.set_as_environment_variables() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\main.py", line 91, in set_as_environment_variables if not self.dict(): ^^^^^^^^^^^ File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\main.py", line 75, in dict self._dict = OrderedDict(resolve_variables(raw_values, override=self.override)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\main.py", line 233, in resolve_variables for (name, value) in values: File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\main.py", line 83, in parse for mapping in with_warn_for_invalid_lines(parse_stream(stream)): File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\main.py", line 25, in with_warn_for_invalid_lines for mapping in mappings: File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\parser.py", line 173, in parse_stream reader = Reader(stream) ^^^^^^^^^^^^^^ File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\parser.py", line 64, in init self.string = stream.read() ^^^^^^^^^^^^^ File "", line 322, in decode UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
You open the .env file with notepad++ then go to Encoding and select UTF-8
Front end => OK
cd backend => OK echo "OPENAI_API_KEY=sk-your-key" > .env => OK poetry install => OK poetry shell => OK poetry run uvicorn main:app --reload --port 7001 => Not working
I'm not familiar with Python code, so I tried to follow the instructions, but when I ran the final command to run the backend project, I encountered the following error. How should I fix this issue? Can someone please help me? :(
poetry run uvicorn main:app --reload --port 7001 INFO: Will watch for changes in these directories: ['D:\Practice Projects\screenshot-to-code\backend'] INFO: Uvicorn running on http://127.0.0.1:7001 (Press CTRL+C to quit) INFO: Started reloader process [16448] using StatReload Process SpawnProcess-1: Traceback (most recent call last): File "C:\Users\ducvi\AppData\Local\Programs\Python\Python312\Lib\multiprocessing\process.py", line 314, in _bootstrap self.run() File "C:\Users\ducvi\AppData\Local\Programs\Python\Python312\Lib\multiprocessing\process.py", line 108, in run self._target(*self._args, **self.kwargs) File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\uvicorn_subprocess.py", line 76, in subprocess_started target(sockets=sockets) File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\uvicorn\server.py", line 61, in run return asyncio.run(self.serve(sockets=sockets)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ducvi\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 194, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "C:\Users\ducvi\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 118, in run return self.loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ducvi\AppData\Local\Programs\Python\Python312\Lib\asyncio\base_events.py", line 664, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\uvicorn\server.py", line 68, in serve config.load() File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\uvicorn\config.py", line 467, in load self.loaded_app = import_from_string(self.app) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\uvicorn\importer.py", line 21, in import_from_string module = importlib.import_module(module_str) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ducvi\AppData\Local\Programs\Python\Python312\Lib\importlib__init.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1381, in _gcd_import File "", line 1354, in _find_and_load File "", line 1325, in _find_and_load_unlocked File "", line 929, in _load_unlocked File "", line 994, in exec_module File "", line 488, in _call_with_frames_removed File "D:\Practice Projects\screenshot-to-code\backend\main.py", line 4, in load_dotenv() File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\main.py", line 346, in load_dotenv return dotenv.set_as_environment_variables() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\main.py", line 91, in set_as_environment_variables if not self.dict(): ^^^^^^^^^^^ File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\main.py", line 75, in dict self._dict = OrderedDict(resolve_variables(raw_values, override=self.override)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\main.py", line 233, in resolve_variables for (name, value) in values: File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\main.py", line 83, in parse for mapping in with_warn_for_invalid_lines(parse_stream(stream)): File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\main.py", line 25, in with_warn_for_invalid_lines for mapping in mappings: File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\parser.py", line 173, in parse_stream reader = Reader(stream) ^^^^^^^^^^^^^^ File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\parser.py", line 64, in init self.string = stream.read() ^^^^^^^^^^^^^ File "", line 322, in decode UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
You open the .env file with notepad++ then go to Encoding and select UTF-8
Thank you, it worked, but I encountered another problem when importing a photo . The UI reports an error saying, 'Error generating code. Check the Developer Console for details. Feel free to open a Github issue.'
The terminal at the BE (Backend) is reporting an error as follows:
poetry run uvicorn main:app --reload --port 7001
INFO: Will watch for changes in these directories: ['D:\Practice Projects\screenshot-to-code\backend']
INFO: Uvicorn running on http://127.0.0.1:7001 (Press CTRL+C to quit)
INFO: Started reloader process [1480] using StatReload
INFO: Started server process [2408]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: ('127.0.0.1', 51398) - "WebSocket /generate-code" [accepted]
INFO: connection open
Using OpenAI API key from environment variable
generating code...
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\uvicorn\protocols\websockets\websockets_impl.py", line 247, in run_asgi
result = await self.app(self.scope, self.asgi_receive, self.asgi_send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\uvicorn\middleware\proxy_headers.py", line 84, in call
return await self.app(scope, receive, send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\fastapi\applications.py", line 276, in call
await super().call(scope, receive, send)
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\starlette\applications.py", line 122, in call
await self.middleware_stack(scope, receive, send)
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\starlette\middleware\errors.py", line 149, in call
await self.app(scope, receive, send)
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\starlette\middleware\exceptions.py", line 79, in call
raise exc
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\starlette\middleware\exceptions.py", line 68, in call
await self.app(scope, receive, sender)
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\fastapi\middleware\asyncexitstack.py", line 21, in call
raise e
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in call
await self.app(scope, receive, send)
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\starlette\routing.py", line 718, in call
await route.handle(scope, receive, send)
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\starlette\routing.py", line 341, in handle
await self.app(scope, receive, send)
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\starlette\routing.py", line 82, in app
await func(session)
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\fastapi\routing.py", line 289, in app
await dependant.call(**values)
File "D:\Practice Projects\screenshot-to-code\backend\main.py", line 100, in stream_code_test
completion = await stream_openai_response(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Practice Projects\screenshot-to-code\backend\llm.py", line 23, in stream_openai_response
completion = await client.chat.completions.create(**params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\openai\resources\chat\completions.py", line 1191, in create
return await self._post(
^^^^^^^^^^^^^^^^^
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\openai_base_client.py", line 1474, in post
return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\openai_base_client.py", line 1275, in request
return await self._request(
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\openai_base_client.py", line 1318, in _request
raise self._make_status_error_from_response(err.response) from None
openai.NotFoundError: Error code: 404 - {'error': {'message': 'The model gpt-4-vision-preview does not exist or you do not have access to it. Learn more: https://help.openai.com/en/articles/7102672-how-can-i-access-gpt-4.', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'}}
INFO: connection closed
@imsamm04 the last line in your logs "message': 'The model gpt-4-vision-preview does not exist or you do not have access to it. Learn more: https://help.openai.com/en/articles/7102672-how-can-i-access-gpt-4.', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'}}". Please see the FAQ for how to get an open ai key that has access to the vision model.
Also, folks, please open a new issue. I'm going to lock this issue in the future since I don't want lots of different discussions going on in one issue.
Guys - open your console, and let us know what it says there so we can help you! Also - make sure you are running with the last code where @abi changed the port. Port 7000 doesn't work on some Macs and docker. It is occupied by Airplay.
@imsamm04 the last line in your logs "message': 'The model gpt-4-vision-preview does not exist or you do not have access to it. Learn more: https://help.openai.com/en/articles/7102672-how-can-i-access-gpt-4.', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'}}". Please see the FAQ for how to get an open ai key that has access to the vision model.
Front end => OK
cd backend => OK echo "OPENAI_API_KEY=sk-your-key" > .env => OK poetry install => OK poetry shell => OK poetry run uvicorn main:app --reload --port 7001 => Not working
I'm not familiar with Python code, so I tried to follow the instructions, but when I ran the final command to run the backend project, I encountered the following error. How should I fix this issue? Can someone please help me? :(
poetry run uvicorn main:app --reload --port 7001 INFO: Will watch for changes in these directories: ['D:\Practice Projects\screenshot-to-code\backend'] INFO: Uvicorn running on http://127.0.0.1:7001 (Press CTRL+C to quit) INFO: Started reloader process [16448] using StatReload Process SpawnProcess-1: Traceback (most recent call last): File "C:\Users\ducvi\AppData\Local\Programs\Python\Python312\Lib\multiprocessing\process.py", line 314, in _bootstrap self.run() File "C:\Users\ducvi\AppData\Local\Programs\Python\Python312\Lib\multiprocessing\process.py", line 108, in run self._target(*self._args, **self.kwargs) File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\uvicorn_subprocess.py", line 76, in subprocess_started target(sockets=sockets) File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\uvicorn\server.py", line 61, in run return asyncio.run(self.serve(sockets=sockets)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ducvi\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 194, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "C:\Users\ducvi\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 118, in run return self.loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ducvi\AppData\Local\Programs\Python\Python312\Lib\asyncio\base_events.py", line 664, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\uvicorn\server.py", line 68, in serve config.load() File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\uvicorn\config.py", line 467, in load self.loaded_app = import_from_string(self.app) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\uvicorn\importer.py", line 21, in import_from_string module = importlib.import_module(module_str) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ducvi\AppData\Local\Programs\Python\Python312\Lib\importlib__init.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1381, in _gcd_import File "", line 1354, in _find_and_load File "", line 1325, in _find_and_load_unlocked File "", line 929, in _load_unlocked File "", line 994, in exec_module File "", line 488, in _call_with_frames_removed File "D:\Practice Projects\screenshot-to-code\backend\main.py", line 4, in load_dotenv() File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\main.py", line 346, in load_dotenv return dotenv.set_as_environment_variables() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\main.py", line 91, in set_as_environment_variables if not self.dict(): ^^^^^^^^^^^ File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\main.py", line 75, in dict self._dict = OrderedDict(resolve_variables(raw_values, override=self.override)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\main.py", line 233, in resolve_variables for (name, value) in values: File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\main.py", line 83, in parse for mapping in with_warn_for_invalid_lines(parse_stream(stream)): File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\main.py", line 25, in with_warn_for_invalid_lines for mapping in mappings: File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\parser.py", line 173, in parse_stream reader = Reader(stream) ^^^^^^^^^^^^^^ File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\parser.py", line 64, in init self.string = stream.read() ^^^^^^^^^^^^^ File "", line 322, in decode UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
You open the .env file with notepad++ then go to Encoding and select UTF-8
Activity
vithanhlam commentedon Nov 16, 2023
you can install
pip install poetryAntouanK commentedon Nov 16, 2023
I tried with venv, I get the same result.
hudzygg commentedon Nov 16, 2023
Getting the exact same errors here. Hope there is a quick fix for this, really excited to try this out.
abi commentedon Nov 16, 2023
pip install poetryshould fix these issues. Is anyone having the issue after they do that still? Happy to help debug.vfonic commentedon Nov 16, 2023
I have installed
poetry. It doesn't look like the issue is resolved by installing poetry.What do you recommend? What can I try? Do you need some logs / command output?
AntouanK commentedon Nov 16, 2023
I have installed poetry in 2 different ways. Made no difference.
If you check the terminal output I posted, the errors are from poetry itself.
abi commentedon Nov 16, 2023
@AntouanK sorry i missed that. your logs suggest it's failing because of a missing README file. I removed that, can you pull and retry?
AntouanK commentedon Nov 16, 2023
there's no README inside backend.
I added an empty one, and still there was an error ( it's in the logs )
I pulled and tried again. same error
have you tried cloning the repo on a new machine and running it?
or maybe try in a python docker container. so you can see what dependencies people need to run it.
thank you.
abi commentedon Nov 16, 2023
@AntouanK People have gotten it working on their machine: #6
I tried locally from scratch (but not in a Docker container). Let me look into it.
AntouanK commentedon Nov 16, 2023
Yeah, I know that the project works.
It's just the setup step.
Could be that it's people that have a python setup on their machine?
( I'm not a python dev, so maybe I'm missing something python related )
AntouanK commentedon Nov 16, 2023
actually I proceed with the last command, and it works fine!
Seems like that error we see is just
poetrysaying "everything is already installed"?Not sure.
It seems to work for me.
Thanks for all the help and your work @abi 👍
vfonic commentedon Nov 16, 2023
Ok, this worked for me:
And
frontendstuff stays the same.I suppose an easier solution would be to do
mv pyproject.toml ../abi commentedon Nov 16, 2023
@vfonic I can see why that works. Python has weird import mechanisms for the root of the project. Glad it worked for you!
abi commentedon Nov 16, 2023
Added some info to the FAQs.
2 remaining items
imsamm04 commentedon Nov 20, 2023
Front end => OK
cd backend => OK
echo "OPENAI_API_KEY=sk-your-key" > .env => OK
poetry install => OK
poetry shell => OK
poetry run uvicorn main:app --reload --port 7001 => Not working
I'm not familiar with Python code, so I tried to follow the instructions, but when I ran the final command to run the backend project, I encountered the following error. How should I fix this issue? Can someone please help me? :(
poetry run uvicorn main:app --reload --port 7001
INFO: Will watch for changes in these directories: ['D:\Practice Projects\screenshot-to-code\backend']
INFO: Uvicorn running on http://127.0.0.1:7001 (Press CTRL+C to quit)
INFO: Started reloader process [16448] using StatReload
Process SpawnProcess-1:
Traceback (most recent call last):
File "C:\Users\ducvi\AppData\Local\Programs\Python\Python312\Lib\multiprocessing\process.py", line 314, in _bootstrap
self.run()
File "C:\Users\ducvi\AppData\Local\Programs\Python\Python312\Lib\multiprocessing\process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\uvicorn_subprocess.py", line 76, in subprocess_started
target(sockets=sockets)
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\uvicorn\server.py", line 61, in run
return asyncio.run(self.serve(sockets=sockets))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ducvi\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 194, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "C:\Users\ducvi\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 118, in run
return self.loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ducvi\AppData\Local\Programs\Python\Python312\Lib\asyncio\base_events.py", line 664, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\uvicorn\server.py", line 68, in serve
config.load()
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\uvicorn\config.py", line 467, in load
self.loaded_app = import_from_string(self.app)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\uvicorn\importer.py", line 21, in import_from_string
module = importlib.import_module(module_str)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ducvi\AppData\Local\Programs\Python\Python312\Lib\importlib_init.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1381, in _gcd_import
File "", line 1354, in _find_and_load
File "", line 1325, in _find_and_load_unlocked
File "", line 929, in _load_unlocked
File "", line 994, in exec_module
File "", line 488, in _call_with_frames_removed
File "D:\Practice Projects\screenshot-to-code\backend\main.py", line 4, in
load_dotenv()
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\main.py", line 346, in load_dotenv
return dotenv.set_as_environment_variables()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\main.py", line 91, in set_as_environment_variables
if not self.dict():
^^^^^^^^^^^
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\main.py", line 75, in dict
self._dict = OrderedDict(resolve_variables(raw_values, override=self.override))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\main.py", line 233, in resolve_variables
for (name, value) in values:
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\main.py", line 83, in parse
for mapping in with_warn_for_invalid_lines(parse_stream(stream)):
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\main.py", line 25, in with_warn_for_invalid_lines
for mapping in mappings:
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\parser.py", line 173, in parse_stream
reader = Reader(stream)
^^^^^^^^^^^^^^
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\dotenv\parser.py", line 64, in init
self.string = stream.read()
^^^^^^^^^^^^^
File "", line 322, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
vithanhlam commentedon Nov 20, 2023
You open the .env file with notepad++ then go to Encoding and select UTF-8
imsamm04 commentedon Nov 20, 2023
Thank you, it worked, but I encountered another problem when importing a photo . The UI reports an error saying, 'Error generating code. Check the Developer Console for details. Feel free to open a Github issue.'
The terminal at the BE (Backend) is reporting an error as follows:
poetry run uvicorn main:app --reload --port 7001
INFO: Will watch for changes in these directories: ['D:\Practice Projects\screenshot-to-code\backend']
INFO: Uvicorn running on http://127.0.0.1:7001 (Press CTRL+C to quit)
INFO: Started reloader process [1480] using StatReload
INFO: Started server process [2408]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: ('127.0.0.1', 51398) - "WebSocket /generate-code" [accepted]
INFO: connection open
Using OpenAI API key from environment variable
generating code...
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\uvicorn\protocols\websockets\websockets_impl.py", line 247, in run_asgi
result = await self.app(self.scope, self.asgi_receive, self.asgi_send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\uvicorn\middleware\proxy_headers.py", line 84, in call
return await self.app(scope, receive, send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\fastapi\applications.py", line 276, in call
await super().call(scope, receive, send)
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\starlette\applications.py", line 122, in call
await self.middleware_stack(scope, receive, send)
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\starlette\middleware\errors.py", line 149, in call
await self.app(scope, receive, send)
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\starlette\middleware\exceptions.py", line 79, in call
raise exc
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\starlette\middleware\exceptions.py", line 68, in call
await self.app(scope, receive, sender)
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\fastapi\middleware\asyncexitstack.py", line 21, in call
raise e
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in call
await self.app(scope, receive, send)
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\starlette\routing.py", line 718, in call
await route.handle(scope, receive, send)
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\starlette\routing.py", line 341, in handle
await self.app(scope, receive, send)
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\starlette\routing.py", line 82, in app
await func(session)
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\fastapi\routing.py", line 289, in app
await dependant.call(**values)
File "D:\Practice Projects\screenshot-to-code\backend\main.py", line 100, in stream_code_test
completion = await stream_openai_response(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Practice Projects\screenshot-to-code\backend\llm.py", line 23, in stream_openai_response
completion = await client.chat.completions.create(**params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\openai\resources\chat\completions.py", line 1191, in create
return await self._post(
^^^^^^^^^^^^^^^^^
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\openai_base_client.py", line 1474, in post
return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\openai_base_client.py", line 1275, in request
return await self._request(
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ducvi\AppData\Local\pypoetry\Cache\virtualenvs\backend-Mnz77ySr-py3.12\Lib\site-packages\openai_base_client.py", line 1318, in _request
raise self._make_status_error_from_response(err.response) from None
openai.NotFoundError: Error code: 404 - {'error': {'message': 'The model
gpt-4-vision-previewdoes not exist or you do not have access to it. Learn more: https://help.openai.com/en/articles/7102672-how-can-i-access-gpt-4.', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'}}INFO: connection closed
PristineJagan commentedon Nov 20, 2023
I'm getting this error while insert screen shot

abi commentedon Nov 20, 2023
@imsamm04 the last line in your logs "message': 'The model gpt-4-vision-preview does not exist or you do not have access to it. Learn more: https://help.openai.com/en/articles/7102672-how-can-i-access-gpt-4.', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'}}". Please see the FAQ for how to get an open ai key that has access to the vision model.
abi commentedon Nov 20, 2023
@PristineJagan are you running locally? If so please look at backends logs.
If it's hosted, not offering support for the demo at the moment. Please run locally.
nhuanh9 commentedon Nov 20, 2023
I run with docker and have error likes PristineJagan
abi commentedon Nov 20, 2023
@Jonathan-Adly any thoughts on the Docker issues here?
Also, folks, please open a new issue. I'm going to lock this issue in the future since I don't want lots of different discussions going on in one issue.
Jonathan-Adly commentedon Nov 20, 2023
Guys - open your console, and let us know what it says there so we can help you! Also - make sure you are running with the last code where @abi changed the port. Port 7000 doesn't work on some Macs and docker. It is occupied by Airplay.
imsamm04 commentedon Nov 21, 2023
thanks , its working now
donghero commentedon Nov 21, 2023
Nice Comment! It works for me! Thanks a lot!
hkcitizens9527 commentedon Nov 21, 2023
me too
abi commentedon Nov 21, 2023
Going to lock this conversation. Please open a new ticket if you have issues that are not solved by the FAQ section.
Update README.md