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

Error generating code. Please contact support. #468

Closed
maixi111 opened this issue Dec 28, 2024 · 1 comment
Closed

Error generating code. Please contact support. #468

maixi111 opened this issue Dec 28, 2024 · 1 comment

Comments

@maixi111
Copy link

Received params
Using openAiApiKey from environment variable
Using official OpenAI URL
Generating html_css code in image mode
Status (variant 0): Generating code...
Status (variant 1): Generating code...
Error generating code. Please contact support.
Traceback (most recent call last):
File "E:\screenshot\screenshot-to-code-main\backend\llm.py", line 62, in stream_openai_response
stream = await client.chat.completions.create(**params) # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ASUS\AppData\Local\pypoetry\Cache\virtualenvs\backend-k6nSzIJV-py3.11\Lib\site-packages\openai\resources\chat\completions.py", line 1720, in create
return await self._post(
^^^^^^^^^^^^^^^^^
File "C:\Users\ASUS\AppData\Local\pypoetry\Cache\virtualenvs\backend-k6nSzIJV-py3.11\Lib\site-packages\openai_base_client.py", line 1843, in post
return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ASUS\AppData\Local\pypoetry\Cache\virtualenvs\backend-k6nSzIJV-py3.11\Lib\site-packages\openai_base_client.py", line 1537, in request
return await self._request(
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ASUS\AppData\Local\pypoetry\Cache\virtualenvs\backend-k6nSzIJV-py3.11\Lib\site-packages\openai_base_client.py", line 1638, in _request
raise self._make_status_error_from_response(err.response) from None
openai.NotFoundError: Error code: 404 - {'error': {'message': 'The model gpt-4o-2024-11-20 does not exist or you do not have access to it.', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'}}
Traceback (most recent call last):
File "E:\screenshot\screenshot-to-code-main\backend\llm.py", line 62, in stream_openai_response
stream = await client.chat.completions.create(**params) # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ASUS\AppData\Local\pypoetry\Cache\virtualenvs\backend-k6nSzIJV-py3.11\Lib\site-packages\openai\resources\chat\completions.py", line 1720, in create
return await self._post(
^^^^^^^^^^^^^^^^^
File "C:\Users\ASUS\AppData\Local\pypoetry\Cache\virtualenvs\backend-k6nSzIJV-py3.11\Lib\site-packages\openai_base_client.py", line 1843, in post
return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ASUS\AppData\Local\pypoetry\Cache\virtualenvs\backend-k6nSzIJV-py3.11\Lib\site-packages\openai_base_client.py", line 1537, in request
return await self._request(
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ASUS\AppData\Local\pypoetry\Cache\virtualenvs\backend-k6nSzIJV-py3.11\Lib\site-packages\openai_base_client.py", line 1638, in _request
raise self._make_status_error_from_response(err.response) from None
openai.NotFoundError: Error code: 404 - {'error': {'message': 'The model gpt-4o-2024-11-20 does not exist or you do not have access to it.', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'}}
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "C:\Users\ASUS\AppData\Local\pypoetry\Cache\virtualenvs\backend-k6nSzIJV-py3.11\Lib\site-packages\uvicorn\protocols\websockets\websockets_impl.py", line 250, in run_asgi
result = await self.app(self.scope, self.asgi_receive, self.asgi_send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ASUS\AppData\Local\pypoetry\Cache\virtualenvs\backend-k6nSzIJV-py3.11\Lib\site-packages\uvicorn\middleware\proxy_headers.py", line 84, in call
return await self.app(scope, receive, send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ASUS\AppData\Local\pypoetry\Cache\virtualenvs\backend-k6nSzIJV-py3.11\Lib\site-packages\fastapi\applications.py", line 1054, in call
await super().call(scope, receive, send)
File "C:\Users\ASUS\AppData\Local\pypoetry\Cache\virtualenvs\backend-k6nSzIJV-py3.11\Lib\site-packages\starlette\applications.py", line 113, in call
await self.middleware_stack(scope, receive, send)
File "C:\Users\ASUS\AppData\Local\pypoetry\Cache\virtualenvs\backend-k6nSzIJV-py3.11\Lib\site-packages\starlette\middleware\errors.py", line 152, in call
await self.app(scope, receive, send)
File "C:\Users\ASUS\AppData\Local\pypoetry\Cache\virtualenvs\backend-k6nSzIJV-py3.11\Lib\site-packages\starlette\middleware\cors.py", line 77, in call
await self.app(scope, receive, send)
File "C:\Users\ASUS\AppData\Local\pypoetry\Cache\virtualenvs\backend-k6nSzIJV-py3.11\Lib\site-packages\starlette\middleware\exceptions.py", line 62, in call
await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
File "C:\Users\ASUS\AppData\Local\pypoetry\Cache\virtualenvs\backend-k6nSzIJV-py3.11\Lib\site-packages\starlette_exception_handler.py", line 53, in wrapped_app
raise exc
File "C:\Users\ASUS\AppData\Local\pypoetry\Cache\virtualenvs\backend-k6nSzIJV-py3.11\Lib\site-packages\starlette_exception_handler.py", line 42, in wrapped_app
await app(scope, receive, sender)
File "C:\Users\ASUS\AppData\Local\pypoetry\Cache\virtualenvs\backend-k6nSzIJV-py3.11\Lib\site-packages\starlette\routing.py", line 715, in call
await self.middleware_stack(scope, receive, send)
File "C:\Users\ASUS\AppData\Local\pypoetry\Cache\virtualenvs\backend-k6nSzIJV-py3.11\Lib\site-packages\starlette\routing.py", line 735, in app
await route.handle(scope, receive, send)
File "C:\Users\ASUS\AppData\Local\pypoetry\Cache\virtualenvs\backend-k6nSzIJV-py3.11\Lib\site-packages\starlette\routing.py", line 362, in handle
await self.app(scope, receive, send)
File "C:\Users\ASUS\AppData\Local\pypoetry\Cache\virtualenvs\backend-k6nSzIJV-py3.11\Lib\site-packages\starlette\routing.py", line 95, in app
await wrap_app_handling_exceptions(app, session)(scope, receive, send)
File "C:\Users\ASUS\AppData\Local\pypoetry\Cache\virtualenvs\backend-k6nSzIJV-py3.11\Lib\site-packages\starlette_exception_handler.py", line 53, in wrapped_app
raise exc
File "C:\Users\ASUS\AppData\Local\pypoetry\Cache\virtualenvs\backend-k6nSzIJV-py3.11\Lib\site-packages\starlette_exception_handler.py", line 42, in wrapped_app
await app(scope, receive, sender)
File "C:\Users\ASUS\AppData\Local\pypoetry\Cache\virtualenvs\backend-k6nSzIJV-py3.11\Lib\site-packages\starlette\routing.py", line 93, in app
await func(session)
File "C:\Users\ASUS\AppData\Local\pypoetry\Cache\virtualenvs\backend-k6nSzIJV-py3.11\Lib\site-packages\fastapi\routing.py", line 383, in app
await dependant.call(**solved_result.values)
File "E:\screenshot\screenshot-to-code-main\backend\routes\generate_code.py", line 335, in stream_code
raise Exception("All generations failed")
Exception: All generations failed
INFO: connection closed

@abi
Copy link
Owner

abi commented Jan 8, 2025

The model gpt-4o-2024-11-20 does not exist or you do not have access to it.', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'

@abi abi closed this as completed Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants