Skip to content

When i use ollama,i can't use command direct to ollama modle. #91

@298068845

Description

@298068845

my ollama have been download ollama3 with command:ollama run Llama3:8B

docker run -it --net=host acr
conda activate auto-code-rover

PYTHONPATH=. python app/main.py github-issue --output-dir output --setup-dir setup --model llama3 --model-temperature 0.2 --task-id langchain-20453 --clone-link https://github.com/langchain-ai/langchain.git --commit-hash cb6e5e5 --issue-link langchain-ai/langchain#20453

and thorw error:
Traceback (most recent call last):
File "/opt/conda/envs/auto-code-rover/lib/python3.12/site-packages/httpx/_transports/default.py", line 69, in map_httpcore_exceptions
yield
File "/opt/conda/envs/auto-code-rover/lib/python3.12/site-packages/httpx/_transports/default.py", line 233, in handle_request
resp = self._pool.handle_request(req)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/auto-code-rover/lib/python3.12/site-packages/httpcore/_sync/connection_pool.py", line 216, in handle_request
raise exc from None
File "/opt/conda/envs/auto-code-rover/lib/python3.12/site-packages/httpcore/_sync/connection_pool.py", line 196, in handle_request
response = connection.handle_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/auto-code-rover/lib/python3.12/site-packages/httpcore/_sync/connection.py", line 99, in handle_request
raise exc
File "/opt/conda/envs/auto-code-rover/lib/python3.12/site-packages/httpcore/_sync/connection.py", line 76, in handle_request
stream = self._connect(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/auto-code-rover/lib/python3.12/site-packages/httpcore/_sync/connection.py", line 122, in _connect
stream = self._network_backend.connect_tcp(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/auto-code-rover/lib/python3.12/site-packages/httpcore/_backends/sync.py", line 205, in connect_tcp
with map_exceptions(exc_map):
File "/opt/conda/envs/auto-code-rover/lib/python3.12/contextlib.py", line 158, in exit
self.gen.throw(value)
File "/opt/conda/envs/auto-code-rover/lib/python3.12/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
raise to_exc(exc) from exc
httpcore.ConnectError: [Errno 111] Connection refused

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

Traceback (most recent call last):
File "/opt/auto-code-rover/app/main.py", line 656, in
main()
File "/opt/auto-code-rover/app/main.py", line 90, in main
common.set_model(config.models[0])
File "/opt/auto-code-rover/app/model/common.py", line 221, in set_model
SELECTED_MODEL.setup()
File "/opt/auto-code-rover/app/model/ollama.py", line 46, in setup
self.send_empty_request()
File "/opt/conda/envs/auto-code-rover/lib/python3.12/site-packages/timeout_decorator/timeout_decorator.py", line 82, in new_function
return function(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/auto-code-rover/app/model/ollama.py", line 63, in send_empty_request
ollama.chat(model=self.name, messages=[])
File "/opt/conda/envs/auto-code-rover/lib/python3.12/site-packages/ollama/_client.py", line 236, in chat
return self._request_stream(
^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/auto-code-rover/lib/python3.12/site-packages/ollama/_client.py", line 99, in _request_stream
return self._stream(*args, **kwargs) if stream else self._request(*args, **kwargs).json()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/auto-code-rover/lib/python3.12/site-packages/ollama/_client.py", line 70, in _request
response = self._client.request(method, url, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/auto-code-rover/lib/python3.12/site-packages/httpx/_client.py", line 827, in request
return self.send(request, auth=auth, follow_redirects=follow_redirects)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/auto-code-rover/lib/python3.12/site-packages/httpx/_client.py", line 914, in send
response = self._send_handling_auth(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/auto-code-rover/lib/python3.12/site-packages/httpx/_client.py", line 942, in _send_handling_auth
response = self._send_handling_redirects(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/auto-code-rover/lib/python3.12/site-packages/httpx/_client.py", line 979, in _send_handling_redirects
response = self._send_single_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/auto-code-rover/lib/python3.12/site-packages/httpx/_client.py", line 1015, in _send_single_request
response = transport.handle_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/auto-code-rover/lib/python3.12/site-packages/httpx/_transports/default.py", line 232, in handle_request
with map_httpcore_exceptions():
File "/opt/conda/envs/auto-code-rover/lib/python3.12/contextlib.py", line 158, in exit
self.gen.throw(value)
File "/opt/conda/envs/auto-code-rover/lib/python3.12/site-packages/httpx/_transports/default.py", line 86, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ConnectError: [Errno 111] Connection refused

I think this command is direct to meta‘s llama3 online,what can i do to solve this problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions