This commit is contained in:
saloui 2024-01-24 12:08:07 +01:00
parent c8b5dc815b
commit 164239936f
4 changed files with 42 additions and 41 deletions

11
app.py
View File

@ -175,17 +175,6 @@ if __name__ == "__main__":
#webbrowser.open(f"http://{config['host']}:{6523}") # needed for debug (to be removed in production)
uvicorn.run(app, host=config.host, port=config.port)
if sio.reboot:
ASCIIColors.info("")
ASCIIColors.info("")
ASCIIColors.info("")
ASCIIColors.info(" ╔══════════════════════════════════════════════════╗")
ASCIIColors.info(" ║ Restarting backend ║")
ASCIIColors.info(" ╚══════════════════════════════════════════════════╝")
ASCIIColors.info("")
ASCIIColors.info("")
ASCIIColors.info("")
lollmsElfServer.run_restart_script(args)
except Exception as ex:
trace_exception(ex)

View File

@ -35,12 +35,23 @@ async def get_lollms_webui_version():
@router.get("/restart_program")
async def restart_program():
"""Restart the program."""
lollmsElfServer.ShowBlockingMessage("Restarting program.\nPlease stand by...")
# Stop the socketIO server
run_async(lollmsElfServer.sio.shutdown)
# Sleep for 1 second before rebooting
time.sleep(1)
lollmsElfServer.HideBlockingMessage()
# Reboot the program
lollmsElfServer.sio.reboot = True
ASCIIColors.info("")
ASCIIColors.info("")
ASCIIColors.info("")
ASCIIColors.info(" ╔══════════════════════════════════════════════════╗")
ASCIIColors.info(" ║ Restarting backend ║")
ASCIIColors.info(" ╚══════════════════════════════════════════════════╝")
ASCIIColors.info("")
ASCIIColors.info("")
ASCIIColors.info("")
lollmsElfServer.run_restart_script(lollmsElfServer.args)
@router.get("/update_software")
async def update_software():

View File

@ -106,8 +106,9 @@ async def text2Audio(request: Request):
@router.get("/install_xtts")
def install_xtts():
try:
from lollms.services.xtts.lollms_xtts import install_xtts
lollmsElfServer.ShowBlockingMessage("Installing xTTS api server\nPlease stand by")
PackageManager.install_package("xtts-api-server")
install_xtts(lollmsElfServer)
lollmsElfServer.HideBlockingMessage()
return {"status":True}
except Exception as ex:

@ -1 +1 @@
Subproject commit 1e1fd5444c92e4e5dccd93061c01cbe677f30404
Subproject commit f4e5aa3d7af0cd20f3af69fa1fae16bbe0342f2f