OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

config_sentence_transformers.json not found in uvicorn startup

Open Nicdelsan opened this issue 1 year ago • 5 comments

Describe the bug When i try to startup the uvicorn server, this error appear:

(OpenDevin-faaYuwYm) C:\Users\Utente\OpenDevin>uvicorn opendevin.server.listen:app --port 3000 Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "C:\Users\Utente\.virtualenvs\OpenDevin-faaYuwYm\Scripts\uvicorn.exe\__main__.py", line 7, in <module> File "C:\Users\Utente\.virtualenvs\OpenDevin-faaYuwYm\Lib\site-packages\click\core.py", line 1157, in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Utente\.virtualenvs\OpenDevin-faaYuwYm\Lib\site-packages\click\core.py", line 1078, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "C:\Users\Utente\.virtualenvs\OpenDevin-faaYuwYm\Lib\site-packages\click\core.py", line 1434, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Utente\.virtualenvs\OpenDevin-faaYuwYm\Lib\site-packages\click\core.py", line 783, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Utente\.virtualenvs\OpenDevin-faaYuwYm\Lib\site-packages\uvicorn\main.py", line 409, in main run( File "C:\Users\Utente\.virtualenvs\OpenDevin-faaYuwYm\Lib\site-packages\uvicorn\main.py", line 575, in run server.run() File "C:\Users\Utente\.virtualenvs\OpenDevin-faaYuwYm\Lib\site-packages\uvicorn\server.py", line 65, in run return asyncio.run(self.serve(sockets=sockets)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.752.0_x64__qbz5n2kfra8p0\Lib\asyncio\runners.py", line 194, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.752.0_x64__qbz5n2kfra8p0\Lib\asyncio\runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.752.0_x64__qbz5n2kfra8p0\Lib\asyncio\base_events.py", line 685, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "C:\Users\Utente\.virtualenvs\OpenDevin-faaYuwYm\Lib\site-packages\uvicorn\server.py", line 69, in serve await self._serve(sockets) File "C:\Users\Utente\.virtualenvs\OpenDevin-faaYuwYm\Lib\site-packages\uvicorn\server.py", line 76, in _serve config.load() File "C:\Users\Utente\.virtualenvs\OpenDevin-faaYuwYm\Lib\site-packages\uvicorn\config.py", line 433, in load self.loaded_app = import_from_string(self.app) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Utente\.virtualenvs\OpenDevin-faaYuwYm\Lib\site-packages\uvicorn\importer.py", line 19, in import_from_string module = importlib.import_module(module_str) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.752.0_x64__qbz5n2kfra8p0\Lib\importlib\__init__.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<frozen importlib._bootstrap>", line 1387, in _gcd_import File "<frozen importlib._bootstrap>", line 1360, in _find_and_load File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 935, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 995, in exec_module File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed File "C:\Users\Utente\OpenDevin\opendevin\server\listen.py", line 4, in <module> import agenthub # noqa F401 (we import this to get the agents registered) ^^^^^^^^^^^^^^^ File "C:\Users\Utente\OpenDevin\agenthub\__init__.py", line 5, in <module> from . import langchains_agent # noqa: E402 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Utente\OpenDevin\agenthub\langchains_agent\__init__.py", line 2, in <module> from .langchains_agent import LangchainsAgent File "C:\Users\Utente\OpenDevin\agenthub\langchains_agent\langchains_agent.py", line 8, in <module> from agenthub.langchains_agent.utils.memory import LongTermMemory File "C:\Users\Utente\OpenDevin\agenthub\langchains_agent\utils\memory.py", line 37, in <module> embed_model = HuggingFaceEmbedding( ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Utente\.virtualenvs\OpenDevin-faaYuwYm\Lib\site-packages\llama_index\embeddings\huggingface\base.py", line 86, in __init__ self._model = SentenceTransformer( ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Utente\.virtualenvs\OpenDevin-faaYuwYm\Lib\site-packages\sentence_transformers\SentenceTransformer.py", line 191, in __init__ modules = self._load_sbert_model( ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Utente\.virtualenvs\OpenDevin-faaYuwYm\Lib\site-packages\sentence_transformers\SentenceTransformer.py", line 1163, in _load_sbert_model with open(config_sentence_transformers_json_path) as fIn: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Utente\\AppData\\Local\\llama_index\\models--BAAI--bge-small-en-v1.5\\snapshots\\5c38ec7c405ec4b44b94cc5a9bb96e735b38267a\\config_sentence_transformers.json'

Steps to Reproduce 1.Start the backend 2.Try to start uvicorn server

Expected behavior It should read all files with succes

Actual behavior After this error, when i try to start the frontend, in the web ui, this is the error message:

ERROR: Failed connection to server. Please ensure the server is reachable at ws://localhost:3000/ws.

Additional context

Nicdelsan avatar Mar 31 '24 10:03 Nicdelsan

Try to run on Linux or Mac OS. If you are on Windows try running on WSL.

It is also mentioned in requirements README.md file to run on WSL if you are using windows.

vdsasi avatar Mar 31 '24 10:03 vdsasi

@Nicdelsan can you tell us more about your environment/setup?

rbren avatar Mar 31 '24 15:03 rbren

I have the same issue while running make start-backend on MacOS Sonoma on M3 Max. It is looking for the same file in my Library directory and fails.

Edit: Actually not the same. The missing file is : /Users/<user>/Library/Caches/llama_index/models--BAAI--bge-small-en-v1.5/snapshots/5c38ec7c405ec4b44b94cc5a9bb96e735b38267a/1_Pooling/config.json

BartoszSiemienczuk avatar Apr 02 '24 10:04 BartoszSiemienczuk

I have the same issue while running make start-backend on MacOS Sonoma on M3 Max. It is looking for the same file in my Library directory and fails.

Edit: Actually not the same. The missing file is : /Users/<user>/Library/Caches/llama_index/models--BAAI--bge-small-en-v1.5/snapshots/5c38ec7c405ec4b44b94cc5a9bb96e735b38267a/1_Pooling/config.json

This helped me get rid of the missing file issue

jay-c88 avatar Apr 02 '24 12:04 jay-c88

here is a fix #573

wesamdev avatar Apr 02 '24 13:04 wesamdev

Seems problem can be temporally solved. Close it now. Need investigate better solution in the future.

yufansong avatar Apr 05 '24 21:04 yufansong

@yufansong is the solution to run that wget? If new users are hitting this I think we need to fix it

rbren avatar Apr 06 '24 00:04 rbren

Is the solution to run that wget

Yes, as mentioned in that comments , currently may need use wget as a workaround.

If new users are hitting this I think we need to fix it

Agree with you, but still think what is a good solution we can do in code.

yufansong avatar Apr 06 '24 00:04 yufansong