Enhanced code

This commit is contained in:
Saifeddine ALOUI 2023-12-28 22:24:05 +01:00
parent 1a49dd9dfc
commit f1fd6521e3
2 changed files with 14 additions and 2 deletions

View File

@ -96,8 +96,6 @@ class LollmsXTTS:
self.auto_xtts_url = self.auto_xtts_base_url+"/sdapi/v1"
shared_folder = root_dir/"shared"
self.xtts_folder = shared_folder / "xtts"
self.output_dir = root_dir / "outputs/sd"
self.output_dir.mkdir(parents=True, exist_ok=True)
ASCIIColors.red(".____ ________ .____ .____ _____ _________ ____ __________________________________ ")

View File

@ -1979,6 +1979,20 @@ class APScript(StateMachine):
if callback:
callback(code, MSG_TYPE.MSG_TYPE_CODE)
def chunk(self, full_text:str, callback: Callable[[str, MSG_TYPE, dict, list], bool]=None):
"""This sends full text to front end
Args:
step_text (dict): The step text
callback (callable, optional): A callable with this signature (str, MSG_TYPE) to send the text to. Defaults to None.
"""
if not callback and self.callback:
callback = self.callback
if callback:
callback(full_text, MSG_TYPE.MSG_TYPE_CHUNK)
def full(self, full_text:str, callback: Callable[[str, MSG_TYPE, dict, list], bool]=None):
"""This sends full text to front end