Skip to content

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

Open

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?

Activity

  1. 298068845 commented on Apr 22, 2025

    @298068845
    Author

    (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#

  2. Marti2203 commented on Apr 22, 2025

    @Marti2203
    Collaborator

    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:11434 while the server is running under host.docker.internal:11434

  3. 298068845 commented on Apr 23, 2025

    @298068845
    Author

    您好,请问您是否可以在 AutoCoderover 程序之外,但在您尝试运行该工具的环境中使用 ollama Python 包?ollama 有可能localhost:11434在服务器运行时尝试读取数据。host.docker.internal:11434

    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.

    from ollama import Client

    client = Client(host='http://host.docker.internal:11434')

    try:
    ... print(client.list())
    ... print("Connection successful!")
    ... except Exception as e:
    ... print(f"Connection failed: {str(e)}")
    ...
    {'models': [{'name': 'Llama3:8B', 'model': 'Llama3:8B', 'modified_at': '2025-04-22T10:59:06.0826181+08:00', 'size': 4661224676, 'digest': '365c0bd3c000a25d28ddbf732fe1c6add414de7275464c4e4d1c3b5fcb5d8ad1', 'details': {'parent_model': '', 'format': 'gguf', 'family': 'llama', 'families': ['llama'], 'parameter_size': '8.0B', 'quantization_level': 'Q4_0'}}, {'name': 'mofanke/acge_text_embedding:latest', 'model': 'mofanke/acge_text_embedding:latest', 'modified_at': '2025-03-18T15:17:43.0844515+08:00', 'size': 651106340, 'digest': 'dd257071cdac817788083ee7baaceae23e0094f3284d730824a39f0de533e37c', 'details': {'parent_model': '', 'format': 'gguf', 'family': 'bert', 'families': ['bert'], 'parameter_size': '325M', 'quantization_level': 'F16'}}, {'name': 'deepseek-r1:7b', 'model': 'deepseek-r1:7b', 'modified_at': '2025-02-13T20:29:24.8521836+08:00', 'size': 4683075271, 'digest': '0a8c266910232fd3291e71e5ba1e058cc5af9d411192cf88b6d30e92b6e73163', 'details': {'parent_model': '', 'format': 'gguf', 'family': 'qwen2', 'families': ['qwen2'], 'parameter_size': '7.6B', 'quantization_level': 'Q4_K_M'}}, {'name': 'deepseek-r1:1.5b', 'model': 'deepseek-r1:1.5b', 'modified_at': '2025-02-12T01:32:30.1589742+08:00', 'size': 1117322599, 'digest': 'a42b25d8c10a841bd24724309898ae851466696a7d7f3a0a408b895538ccbc96', 'details': {'parent_model': '', 'format': 'gguf', 'family': 'qwen2', 'families': ['qwen2'], 'parameter_size': '1.8B', 'quantization_level': 'Q4_K_M'}}]}
    Connection successful!

  4. Marti2203 commented on Apr 23, 2025

    @Marti2203
    Collaborator

    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

  5. 298068845 commented on Apr 23, 2025

    @298068845
    Author

    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

    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

  6. Marti2203 commented on Apr 23, 2025

    @Marti2203
    Collaborator

    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 wrote

  7. Marti2203 commented on Apr 23, 2025

    @Marti2203
    Collaborator

    Can you please send the command you used, wrapped in backticks? I am not sure what exactly you have written.

  8. 298068845 commented on Apr 23, 2025

    @298068845
    Author

    Image
    Finnaly,I get this result,Is this caused by my fault?What is the result of your operation with this sample?

  9. Marti2203 commented on Apr 23, 2025

    @Marti2203
    Collaborator

    We do not support reproducers on github tasks. The public version of AutoCodeRover has support for reproducers on SWE-Bench tasks

  10. 298068845 commented on Apr 24, 2025

    @298068845
    Author

    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?

  11. 298068845 commented on Apr 24, 2025

    @298068845
    Author

    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

  12. Marti2203 commented on Apr 24, 2025

    @Marti2203
    Collaborator

    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

  13. Marti2203 commented on Apr 24, 2025

    @Marti2203
    Collaborator

    @298068845 can you explain the EAS message?

  14. 298068845 commented on Apr 24, 2025

    @298068845
    Author

    Image
    I use llama3:8b model,langchain issue langchain-ai/langchain#20453

  15. Marti2203 commented on Apr 24, 2025

    @Marti2203
    Collaborator

    the EAS thing is from the langchain issue. Can you send me the issue.json folder. I have also pushed a patch

  16. 298068845 commented on Apr 24, 2025

    @298068845
    Author
  17. Marti2203 commented on Apr 24, 2025

    @Marti2203
    Collaborator
      File "/opt/auto-code-rover/app/task.py", line 103, in execute_reproducer
        raise NotImplementedError
    

    Can you pull and try again. As mentioned in the previous comment, this is due to a bug in the argument parsing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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