Repository navigation
When i use ollama,i can't use command direct to ollama modle. #91
Description
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?
Activity
298068845 commentedon Apr 22, 2025
(auto-code-rover) root@b4b6f66034c1:/opt/auto-code-rover# curl http://host.docker.internal:11434
Ollama is running
(auto-code-rover) root@b4b6f66034c1:/opt/auto-code-rover#
Marti2203 commentedon Apr 22, 2025
Hi, can you confirm if you can use the ollama python package outside of the autocoderover program but in the environment you are trying to run the tool? It is possible that ollama is trying to read
localhost:11434while the server is running underhost.docker.internal:11434298068845 commentedon Apr 23, 2025
Hello,I use this way to test:(auto-code-rover) root@b4b6f66034c1:/opt/auto-code-rover# python
Python 3.12.5 | packaged by Anaconda, Inc. | (main, Sep 12 2024, 18:27:27) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
Marti2203 commentedon Apr 23, 2025
I see but this is not a correct comparison as the ollama module is not calling that. I think that you should modify the source code to include the host URL
298068845 commentedon Apr 23, 2025
can you tell me where should i modify?I read the main.py,model/ollama.py but could not find the host URL where to set
Marti2203 commentedon Apr 23, 2025
model/ollama.py, in it we do the calls. Instead of directly doing ollama.chat, you need to create a new client similar to the example you wroteMarti2203 commentedon Apr 23, 2025
Can you please send the command you used, wrapped in backticks? I am not sure what exactly you have written.
298068845 commentedon Apr 23, 2025
Finnaly,I get this result,Is this caused by my fault?What is the result of your operation with this sample?
Marti2203 commentedon Apr 23, 2025
We do not support reproducers on github tasks. The public version of AutoCodeRover has support for reproducers on SWE-Bench tasks
298068845 commentedon Apr 24, 2025
I try some issue to use AutoCodeRover ,but still “No patch generated.”,only give me AutoCodeRover ,Reproducer Test Generation in cmd,What‘s issue can be solve to output patch?
298068845 commentedon Apr 24, 2025
Please note that you need to replace "your_service_url" and "your_service_token" with your actual EAS service URL and token.
I can't find the content about "EAS" in EXPERIMENT.md,TESTING.md
Marti2203 commentedon Apr 24, 2025
Hi, the flag for the reproduce and review flag was set to true by default. I am patching it as it should have been false
Marti2203 commentedon Apr 24, 2025
@298068845 can you explain the EAS message?
298068845 commentedon Apr 24, 2025
I use llama3:8b model,langchain issue langchain-ai/langchain#20453
Marti2203 commentedon Apr 24, 2025
the EAS thing is from the langchain issue. Can you send me the issue.json folder. I have also pushed a patch
298068845 commentedon Apr 24, 2025
langchain-20453_2025-04-24_06-31-00.zip
Marti2203 commentedon Apr 24, 2025
Can you pull and try again. As mentioned in the previous comment, this is due to a bug in the argument parsing.