This commit is contained in:
Saifeddine ALOUI 2024-01-10 00:08:13 +01:00
parent 6708243a62
commit c86dbe7e59
3 changed files with 9 additions and 5 deletions

View File

@ -159,7 +159,7 @@ async def serve_outputs(path: str):
Returns:
FileResponse: The file response containing the requested output file.
"""
root_dir = lollmsElfServer.lollms_paths.personal_path / "outputs"
root_dir = lollmsElfServer.lollms_paths.personal_outputs_path
root_dir.mkdir(exist_ok=True, parents=True)
file_path = root_dir / path

View File

@ -8,6 +8,8 @@ description:
"""
from fastapi import APIRouter, Request
from fastapi import HTTPException
from fastapi.responses import FileResponse
from pydantic import BaseModel
import pkg_resources
from lollms.server.elf_server import LOLLMSElfServer
@ -482,7 +484,7 @@ def set_active_personality_settings(data):
# ------------------------------------------- Interaction with personas ------------------------------------------------
@router.get("/post_to_personality")
@router.post("/post_to_personality")
def post_to_personality(data):
"""Post data to a personality"""
if hasattr(lollmsElfServer.personality.processor,'handle_request'):
@ -491,7 +493,7 @@ def post_to_personality(data):
return {}
@router.get("/post_to_personality")
@router.get("/get_current_personality_files_list")
def get_current_personality_files_list():
if lollmsElfServer.personality is None:
return {"state":False, "error":"No personality selected"}

View File

@ -54,8 +54,10 @@ def run_async(func):
asyncio.create_task(func())
else:
# We're not in a running event loop, so we need to create one and run the function in it
asyncio.run(func())
try:
asyncio.run(func())
except:
func()
def terminate_thread(thread):
if thread:
if not thread.is_alive():