Skip to content

Commit e9de90f

Browse files
committed
fix pydantic (#465, #468)
add --no-react --no-database advanced flags
1 parent 6540d1f commit e9de90f

File tree

3 files changed

+29
-12
lines changed

3 files changed

+29
-12
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@
7474

7575
## Changelog
7676

77+
Apr 02:
78+
* Fix pydantic (#465, #468)
79+
* Add --no-react --no-database advanced flags
80+
81+
## March 2025
82+
7783
Mar 21:
7884
* Add CosyVoice extension [Unstable] and GPT-SoVITS [Alpha] extension
7985

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ fairseq @ https://github.com/rsxdalv/fairseq/releases/download/v0.12.3/fairseq-0
1717
fairseq @ https://github.com/rsxdalv/fairseq/releases/download/v0.12.3/fairseq-0.12.13-cp310-cp310-macosx_11_0_universal2.whl ; sys_platform == 'darwin' # MIT License
1818
accelerate>=0.33.0
1919
# optimum-quanto==0.2.6
20+
pydantic==2.10.6 # for gradio 5.5.0 fix

server.py

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -346,18 +346,28 @@ def signal_handler(signal, frame, postgres_process):
346346
stop_postgres(postgres_process)
347347
sys.exit(0)
348348

349-
print("Starting React UI...")
350-
subprocess.Popen(
351-
"npm start --prefix react-ui",
352-
env={
353-
**os.environ,
354-
"GRADIO_BACKEND_AUTOMATIC": f"http://127.0.0.1:{gradio_interface_options['server_port']}",
355-
},
356-
shell=True,
357-
)
358-
if "--docker" in os.sys.argv:
359-
print("Info: Docker mode: skipping Postgres")
349+
# Check for --no-react flag
350+
if "--no-react" not in os.sys.argv:
351+
print("Starting React UI...")
352+
subprocess.Popen(
353+
"npm start --prefix react-ui",
354+
env={
355+
**os.environ,
356+
"GRADIO_BACKEND_AUTOMATIC": f"http://127.0.0.1:{gradio_interface_options['server_port']}",
357+
},
358+
shell=True,
359+
)
360+
else:
361+
print("Skipping React UI (--no-react flag detected)")
362+
363+
# Check for --no-database or docker flag
364+
if "--no-database" in os.sys.argv or "--docker" in os.sys.argv:
365+
if "--docker" in os.sys.argv:
366+
print("Info: Docker mode: skipping Postgres")
367+
else:
368+
print("Skipping Postgres (--no-database flag detected)")
360369
return
370+
361371
print("Starting Postgres...")
362372
postgres_process = subprocess.Popen(f"postgres -D {postgres_dir} -p 7773", shell=True)
363373
try:
@@ -386,7 +396,7 @@ def signal_handler(signal, frame, postgres_process):
386396
server_hypervisor()
387397
import webbrowser
388398

389-
if gradio_interface_options["inbrowser"]:
399+
if gradio_interface_options["inbrowser"] and "--no-react" not in os.sys.argv:
390400
webbrowser.open("http://localhost:3000")
391401

392402
start_gradio_server()

0 commit comments

Comments
 (0)