mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2024-12-19 20:37:51 +00:00
fix
This commit is contained in:
parent
c8b5dc815b
commit
164239936f
13
app.py
13
app.py
@ -175,18 +175,7 @@ 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)
|
||||
|
||||
|
@ -34,36 +34,47 @@ async def get_lollms_webui_version():
|
||||
|
||||
@router.get("/restart_program")
|
||||
async def restart_program():
|
||||
"""Restart the program."""
|
||||
# Stop the socketIO server
|
||||
run_async(lollmsElfServer.sio.shutdown)
|
||||
# Sleep for 1 second before rebooting
|
||||
time.sleep(1)
|
||||
# Reboot the program
|
||||
lollmsElfServer.sio.reboot = True
|
||||
|
||||
"""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
|
||||
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():
|
||||
"""Update the software."""
|
||||
# Display an informative message
|
||||
ASCIIColors.info("")
|
||||
ASCIIColors.info("")
|
||||
ASCIIColors.info("")
|
||||
ASCIIColors.info("╔══════════════════════════════════════════════════╗")
|
||||
ASCIIColors.info("║ Updating backend ║")
|
||||
ASCIIColors.info("╚══════════════════════════════════════════════════╝")
|
||||
ASCIIColors.info("")
|
||||
ASCIIColors.info("")
|
||||
ASCIIColors.info("")
|
||||
# Stop the socketIO server
|
||||
await lollmsElfServer.sio.shutdown()
|
||||
# Sleep for 1 second before rebooting
|
||||
time.sleep(1)
|
||||
"""Update the software."""
|
||||
# Display an informative message
|
||||
ASCIIColors.info("")
|
||||
ASCIIColors.info("")
|
||||
ASCIIColors.info("")
|
||||
ASCIIColors.info("╔══════════════════════════════════════════════════╗")
|
||||
ASCIIColors.info("║ Updating backend ║")
|
||||
ASCIIColors.info("╚══════════════════════════════════════════════════╝")
|
||||
ASCIIColors.info("")
|
||||
ASCIIColors.info("")
|
||||
ASCIIColors.info("")
|
||||
# Stop the socketIO server
|
||||
await lollmsElfServer.sio.shutdown()
|
||||
# Sleep for 1 second before rebooting
|
||||
time.sleep(1)
|
||||
|
||||
# Run the update script using the provided arguments
|
||||
lollmsElfServer.run_update_script(lollmsElfServer.args)
|
||||
# Exit the program after successful update
|
||||
sys.exit()
|
||||
# Run the update script using the provided arguments
|
||||
lollmsElfServer.run_update_script(lollmsElfServer.args)
|
||||
# Exit the program after successful update
|
||||
sys.exit()
|
||||
|
||||
|
||||
@router.get("/check_update")
|
||||
|
@ -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
|
Loading…
Reference in New Issue
Block a user