CyberAgentAILab / OpenCOLE

OpenCOLE: Towards Reproducible Automatic Graphic Design Generation [Inoue+, CVPRW2024 (GDUG)]
Apache License 2.0
47 stars 5 forks source link

httpcore.UnsupportedProtocol: Request URL is missing an 'http://' or 'https://' protocol. #8

Closed TrNgTinh closed 4 months ago

TrNgTinh commented 4 months ago

Issue Description

When running K-shot LLM, I encountered a missing input_variables parameter in the code at this line I noticed the absence of the input_variables key in template_kwargs. I updated the code as follows:

 messages.append(FewShotChatMessagePromptTemplate(
           input_variables=["intention"],
           example_selector=template_kwargs["example_selector"],
           example_prompt=template_kwargs["example_prompt"]
)

However, I am still encountering an error. I am running this in a Docker environment. Can you give me any suggestions about this ...

Error Traceback

Traceback (most recent call last): File "/root/.cache/pypoetry/virtualenvs/opencole-9TtSrW0h-py3.10/lib/python3.10/site-packages/httpx/_transports/default.py", line 69, in map_httpcore_exceptions yield File "/root/.cache/pypoetry/virtualenvs/opencole-9TtSrW0h-py3.10/lib/python3.10/site-packages/httpx/_transports/default.py", line 233, in handle_request resp = self._pool.handle_request(req) File "/root/.cache/pypoetry/virtualenvs/opencole-9TtSrW0h-py3.10/lib/python3.10/site-packages/httpcore/_sync/connection_pool.py", line 167, in handle_request raise UnsupportedProtocol( httpcore.UnsupportedProtocol: Request URL is missing an 'http://' or 'https://' protocol.

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/root/.cache/pypoetry/virtualenvs/opencole-9TtSrW0h-py3.10/lib/python3.10/site-packages/openai/_base_client.py", line 978, in _request response = self._client.send( File "/root/.cache/pypoetry/virtualenvs/opencole-9TtSrW0h-py3.10/lib/python3.10/site-packages/httpx/_client.py", line 914, in send response = self._send_handling_auth( File "/root/.cache/pypoetry/virtualenvs/opencole-9TtSrW0h-py3.10/lib/python3.10/site-packages/httpx/_client.py", line 942, in _send_handling_auth response = self._send_handling_redirects( File "/root/.cache/pypoetry/virtualenvs/opencole-9TtSrW0h-py3.10/lib/python3.10/site-packages/httpx/_client.py", line 979, in _send_handling_redirects response = self._send_single_request(request) File "/root/.cache/pypoetry/virtualenvs/opencole-9TtSrW0h-py3.10/lib/python3.10/site-packages/httpx/_client.py", line 1015, in _send_single_request response = transport.handle_request(request) File "/root/.cache/pypoetry/virtualenvs/opencole-9TtSrW0h-py3.10/lib/python3.10/site-packages/httpx/_transports/default.py", line 232, in handle_request with map_httpcore_exceptions(): File "/usr/local/lib/python3.10/contextlib.py", line 153, in exit self.gen.throw(typ, value, traceback) File "/root/.cache/pypoetry/virtualenvs/opencole-9TtSrW0h-py3.10/lib/python3.10/site-packages/httpx/_transports/default.py", line 86, in map_httpcore_exceptions raise mapped_exc(message) from exc httpx.UnsupportedProtocol: Request URL is missing an 'http://' or 'https://' protocol.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/root/.cache/pypoetry/virtualenvs/opencole-9TtSrW0h-py3.10/lib/python3.10/site-packages/openai/_base_client.py", line 978, in _request response = self._client.send( File "/root/.cache/pypoetry/virtualenvs/opencole-9TtSrW0h-py3.10/lib/python3.10/site-packages/httpx/_client.py", line 914, in send response = self._send_handling_auth( File "/root/.cache/pypoetry/virtualenvs/opencole-9TtSrW0h-py3.10/lib/python3.10/site-packages/httpx/_client.py", line 942, in _send_handling_auth response = self._send_handling_redirects( File "/root/.cache/pypoetry/virtualenvs/opencole-9TtSrW0h-py3.10/lib/python3.10/site-packages/httpx/_client.py", line 979, in _send_handling_redirects response = self._send_single_request(request) File "/root/.cache/pypoetry/virtualenvs/opencole-9TtSrW0h-py3.10/lib/python3.10/site-packages/httpx/_client.py", line 1015, in _send_single_request response = transport.handle_request(request) File "/root/.cache/pypoetry/virtualenvs/opencole-9TtSrW0h-py3.10/lib/python3.10/site-packages/httpx/_transports/default.py", line 232, in handle_request with map_httpcore_exceptions(): File "/usr/local/lib/python3.10/contextlib.py", line 153, in exit self.gen.throw(typ, value, traceback) File "/root/.cache/pypoetry/virtualenvs/opencole-9TtSrW0h-py3.10/lib/python3.10/site-packages/httpx/_transports/default.py", line 86, in map_httpcore_exceptions raise mapped_exc(message) from exc httpx.UnsupportedProtocol: Request URL is missing an 'http://' or 'https://' protocol.

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/app/src/opencole/inference_launcher/k_shot_llm.py", line 169, in main() File "/app/src/opencole/inference_launcher/k_shotllm.py", line 141, in main detail = tester({"intention": example.intention}) File "/app/src/opencole/inference/tester.py", line 592, in call output = self.chain.invoke(input) File "/root/.cache/pypoetry/virtualenvs/opencole-9TtSrW0h-py3.10/lib/python3.10/site-packages/langchain_core/runnables/base.py", line 2499, in invoke input = step.invoke(input, config) File "/root/.cache/pypoetry/virtualenvs/opencole-9TtSrW0h-py3.10/lib/python3.10/site-packages/langchain_core/language_models/chat_models.py", line 280, in invoke self.generate_prompt( File "/root/.cache/pypoetry/virtualenvs/opencole-9TtSrW0h-py3.10/lib/python3.10/site-packages/langchain_core/language_models/chat_models.py", line 713, in generate_prompt return self.generate(prompt_messages, stop=stop, callbacks=callbacks, kwargs) File "/root/.cache/pypoetry/virtualenvs/opencole-9TtSrW0h-py3.10/lib/python3.10/site-packages/langchain_core/language_models/chat_models.py", line 570, in generate raise e File "/root/.cache/pypoetry/virtualenvs/opencole-9TtSrW0h-py3.10/lib/python3.10/site-packages/langchain_core/language_models/chat_models.py", line 560, in generate self._generate_with_cache( File "/root/.cache/pypoetry/virtualenvs/opencole-9TtSrW0h-py3.10/lib/python3.10/site-packages/langchain_core/language_models/chat_models.py", line 785, in _generate_with_cache result = self._generate( File "/root/.cache/pypoetry/virtualenvs/opencole-9TtSrW0h-py3.10/lib/python3.10/site-packages/langchain_openai/chat_models/base.py", line 547, in _generate response = self.client.create(payload) File "/root/.cache/pypoetry/virtualenvs/opencole-9TtSrW0h-py3.10/lib/python3.10/site-packages/openai/_utils/_utils.py", line 277, in wrapper return func(*args, **kwargs) File "/root/.cache/pypoetry/virtualenvs/opencole-9TtSrW0h-py3.10/lib/python3.10/site-packages/openai/resources/chat/completions.py", line 643, in create return self._post( File "/root/.cache/pypoetry/virtualenvs/opencole-9TtSrW0h-py3.10/lib/python3.10/site-packages/openai/_base_client.py", line 1266, in post return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)) File "/root/.cache/pypoetry/virtualenvs/opencole-9TtSrW0h-py3.10/lib/python3.10/site-packages/openai/_base_client.py", line 942, in request return self._request( File "/root/.cache/pypoetry/virtualenvs/opencole-9TtSrW0h-py3.10/lib/python3.10/site-packages/openai/_base_client.py", line 1002, in _request return self._retry_request( File "/root/.cache/pypoetry/virtualenvs/opencole-9TtSrW0h-py3.10/lib/python3.10/site-packages/openai/_base_client.py", line 1079, in _retry_request return self._request( File "/root/.cache/pypoetry/virtualenvs/opencole-9TtSrW0h-py3.10/lib/python3.10/site-packages/openai/_base_client.py", line 1002, in _request return self._retry_request( File "/root/.cache/pypoetry/virtualenvs/opencole-9TtSrW0h-py3.10/lib/python3.10/site-packages/openai/_base_client.py", line 1079, in _retry_request return self._request( File "/root/.cache/pypoetry/virtualenvs/opencole-9TtSrW0h-py3.10/lib/python3.10/site-packages/openai/_base_client.py", line 1012, in _request raise APIConnectionError(request=request) from err openai.APIConnectionError: Connection error.

TrNgTinh commented 4 months ago

I think this is a problem with my network. :(