Shaunwei / RealChar

🎙️🤖Create, Customize and Talk to your AI Character/Companion in Realtime (All in One Codebase!). Have a natural seamless conversation with AI everywhere (mobile, web and terminal) using LLM OpenAI GPT3.5/4, Anthropic Claude2, Chroma Vector DB, Whisper Speech2Text, ElevenLabs Text2Speech🎙️🤖
https://RealChar.ai/
MIT License
5.94k stars 727 forks source link

python cli.py run-uvicorn , error!!! #488

Open dappbujiujiu opened 9 months ago

dappbujiujiu commented 9 months ago

$ sudo python3.10 cli.py run-uvicorn Running uvicorn server... 2023-11-16 17:49:26,211 - load_characters - catalog_manager.py - INFO - Loaded 15 characters: IDs ['unreal_speech', 'mark_zuckerberg', 'helen_inhabitants_zone', 'raiden_shogun_and_ei_avatar', 'the_cat', 'ion_stoica', 'arnold_schwarzenegger', 'keanu_reeves', 'the_dolphin', 'elon_musk', 'loki', 'raiden_shogun_and_ei', 'sam_altman', 'bruce_wayne', 'steve_jobs'] 2023-11-16 17:49:26,224 - init - catalog_manager.py - INFO - Total document load: 0 2023-11-16 17:49:26,225 - load_character_from_sql_database - catalog_manager.py - INFO - Started loading characters from SQL database 2023-11-16 17:49:26,236 - init - elevenlabs.py - INFO - Initializing [ElevenLabs Text To Speech] voices... 2023-11-16 17:49:26,238 - load_character_from_sql_database - catalog_manager.py - INFO - Loaded 0 characters from sql database 2023-11-16 17:49:40,360 - init - whisper.py - INFO - Loading [Local Whisper] model: base ... 2023-11-16 17:49:56,241 - load_character_from_sql_database - catalog_manager.py - INFO - Started loading characters from SQL database 2023-11-16 17:49:56,244 - load_character_from_sql_database - catalog_manager.py - INFO - Loaded 0 characters from sql database 2023-11-16 17:50:26,247 - load_character_from_sql_database - catalog_manager.py - INFO - Started loading characters from SQL database 2023-11-16 17:50:26,249 - load_character_from_sql_database - catalog_manager.py - INFO - Loaded 0 characters from sql database

2023-11-16 17:50:56,250 - load_character_from_sql_database - catalog_manager.py - INFO - Started loading characters from SQL database 2023-11-16 17:50:56,251 - load_character_from_sql_database - catalog_manager.py - INFO - Loaded 0 characters from sql database 2023-11-16 17:51:26,252 - load_character_from_sql_database - catalog_manager.py - INFO - Started loading characters from SQL database 2023-11-16 17:51:26,253 - load_character_from_sql_database - catalog_manager.py - INFO - Loaded 0 characters from sql database 2023-11-16 17:51:56,255 - load_character_from_sql_database - catalog_manager.py - INFO - Started loading characters from SQL database 2023-11-16 17:51:56,258 - load_character_from_sql_database - catalog_manager.py - INFO - Loaded 0 characters from sql database An error occured while synchronizing the model guillaumekln/faster-whisper-base from the Hugging Face Hub: (MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /api/models/guillaumekln/faster-whisper-base/revision/main (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x12f17a800>, 'Connection to huggingface.co timed out. (connect timeout=None)'))"), '(Request ID: 826efefd-7659-4134-87a6-b5a0fc5444b0)') Trying to load the model directly from the local cache, if it exists. Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/urllib3/connection.py", line 174, in _new_conn conn = connection.create_connection( File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/urllib3/util/connection.py", line 95, in create_connection raise err File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/urllib3/util/connection.py", line 85, in create_connection sock.connect(sa) TimeoutError: [Errno 60] Operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request( File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/urllib3/connectionpool.py", line 404, in _make_request self._validate_conn(conn) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1058, in _validate_conn conn.connect() File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/urllib3/connection.py", line 363, in connect self.sock = conn = self._new_conn() File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/urllib3/connection.py", line 179, in _new_conn raise ConnectTimeoutError( urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.HTTPSConnection object at 0x12f17a800>, 'Connection to huggingface.co timed out. (connect timeout=None)')

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/requests/adapters.py", line 486, in send resp = conn.urlopen( File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/urllib3/connectionpool.py", line 799, in urlopen retries = retries.increment( File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/urllib3/util/retry.py", line 592, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /api/models/guillaumekln/faster-whisper-base/revision/main (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x12f17a800>, 'Connection to huggingface.co timed out. (connect timeout=None)'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/faster_whisper/utils.py", line 98, in download_model return huggingface_hub.snapshot_download(repo_id, kwargs) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, *kwargs) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/huggingface_hub/_snapshot_download.py", line 189, in snapshot_download repo_info = api.repo_info(repo_id=repo_id, repo_type=repo_type, revision=revision, token=token) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(args, kwargs) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/huggingface_hub/hf_api.py", line 1888, in repo_info return method( File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(args, kwargs) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/huggingface_hub/hf_api.py", line 1697, in model_info r = get_session().get(path, headers=headers, timeout=timeout, params=params) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/requests/sessions.py", line 602, in get return self.request("GET", url, kwargs) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, send_kwargs) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, kwargs) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/huggingface_hub/utils/_http.py", line 63, in send return super().send(request, args, **kwargs) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/requests/adapters.py", line 507, in send raise ConnectTimeout(e, request=request) requests.exceptions.ConnectTimeout: (MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /api/models/guillaumekln/faster-whisper-base/revision/main (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x12f17a800>, 'Connection to huggingface.co timed out. (connect timeout=None)'))"), '(Request ID: 826efefd-7659-4134-87a6-b5a0fc5444b0)')

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.10/bin/uvicorn", line 8, in sys.exit(main()) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py", line 1157, in call return self.main(args, kwargs) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, ctx.params) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py", line 783, in invoke return __callback(args, kwargs) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/uvicorn/main.py", line 416, in main run( File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/uvicorn/main.py", line 587, in run server.run() File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/uvicorn/server.py", line 61, in run return asyncio.run(self.serve(sockets=sockets)) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/uvicorn/server.py", line 68, in serve config.load() File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/uvicorn/config.py", line 467, in load self.loaded_app = import_from_string(self.app) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/uvicorn/importer.py", line 21, in import_from_string module = importlib.import_module(module_str) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/Users/songchao/project/RealChar/realtime_ai_character/main.py", line 70, in get_speech_to_text() File "/Users/songchao/project/RealChar/realtime_ai_character/audio/speech_to_text/init.py", line 14, in get_speech_to_text Whisper.initialize(use='local') File "/Users/songchao/project/RealChar/realtime_ai_character/utils.py", line 77, in initialize cls._instances[cls] = cls(args, kwargs) File "/Users/songchao/project/RealChar/realtime_ai_character/audio/speech_to_text/whisper.py", line 48, in init self.model = WhisperModel( File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/faster_whisper/transcribe.py", line 122, in init model_path = download_model( File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/faster_whisper/utils.py", line 114, in download_model return huggingface_hub.snapshot_download(repo_id, kwargs) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(args, kwargs) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/huggingface_hub/_snapshot_download.py", line 172, in snapshot_download with open(ref_path) as f: FileNotFoundError: [Errno 2] No such file or directory: '/Users/songchao/.cache/huggingface/hub/models--guillaumekln--faster-whisper-base/refs/main'

davidtkeane commented 3 weeks ago

Hello, I hope you got your issue sorted out!

I am having a similar problem after running docker compose up.

  1. made a conda env, installed requirements as the instructions goes.
  2. I can get the webpage, but all options do not work, even the login button didn't work, it opened a window but closed again.
  3. Macbook pro m3. Python 3.11.9
  4. I install using git clone and the other instructions, got backend server and front end up but a similar problem.

backend-1 | 2024-08-05 20:39:27,280 - load_character_from_sql_database - catalog_manager.py - INFO - Loaded 0 characters from sql database backend-1 | INFO: 127.0.0.1:47876 - "GET /status HTTP/1.1" 200 OK backend-1 | INFO: 127.0.0.1:52132 - "GET /status HTTP/1.1" 200 OK backend-1 | INFO: 127.0.0.1:47170 - "GET /status HTTP/1.1" 200 OK backend-1 | 2024-08-05 20:39:57,288 - load_character_from_sql_database - catalog_manager.py - INFO - Started loading characters from SQL database backend-1 | 2024-08-05 20:39:57,296 - load_character_from_sql_database - catalog_manager.py - INFO - Loaded 0 characters from sql database backend-1 | INFO: 127.0.0.1:59930 - "GET /status HTTP/1.1" 200 OK backend-1 | INFO: 127.0.0.1:47666 - "GET /status HTTP/1.1" 200 OK