liumaolin commited on
Commit
824183a
·
1 Parent(s): 26079e1

Enhance `main.py`: add `multiprocessing.freeze_support()` for compatibility and improve `lib_path` existence check before modifying sys.path.

Browse files
Files changed (1) hide show
  1. main.py +3 -1
main.py CHANGED
@@ -3,12 +3,13 @@ import sys
3
  import time
4
  import typing
5
  from pathlib import Path
 
6
 
7
  import uvicorn
8
 
9
  HERE = Path(__file__).parent
10
  lib_path = HERE / "src"
11
- if lib_path.as_posix() not in sys.path:
12
  sys.path.insert(0, lib_path.as_posix())
13
 
14
  from voice_dialogue.core.constants import (
@@ -346,4 +347,5 @@ VoiceDialogue - 语音对话系统
346
 
347
 
348
  if __name__ == '__main__':
 
349
  main()
 
3
  import time
4
  import typing
5
  from pathlib import Path
6
+ import multiprocessing
7
 
8
  import uvicorn
9
 
10
  HERE = Path(__file__).parent
11
  lib_path = HERE / "src"
12
+ if lib_path.exists() and lib_path.as_posix() not in sys.path:
13
  sys.path.insert(0, lib_path.as_posix())
14
 
15
  from voice_dialogue.core.constants import (
 
347
 
348
 
349
  if __name__ == '__main__':
350
+ multiprocessing.freeze_support()
351
  main()