mirror of
https://github.com/ParisNeo/lollms.git
synced 2025-01-11 15:32:50 +00:00
removed unnecessary stuff
This commit is contained in:
parent
32c7f3ef9f
commit
718855cb32
@ -164,7 +164,6 @@ class LollmsXTTS:
|
|||||||
|
|
||||||
def run_xtts_api_server(self):
|
def run_xtts_api_server(self):
|
||||||
# Get the path to the current Python interpreter
|
# Get the path to the current Python interpreter
|
||||||
python_path = sys.executable
|
|
||||||
ASCIIColors.yellow("Loading XTTS ")
|
ASCIIColors.yellow("Loading XTTS ")
|
||||||
options= ""
|
options= ""
|
||||||
if self.use_deep_speed:
|
if self.use_deep_speed:
|
||||||
@ -192,6 +191,7 @@ class LollmsXTTS:
|
|||||||
print("Service is available.")
|
print("Service is available.")
|
||||||
if self.app is not None:
|
if self.app is not None:
|
||||||
self.app.success("XTTS Service is now available.")
|
self.app.success("XTTS Service is now available.")
|
||||||
|
self.tts_to_audio("xtts is ready",)
|
||||||
self.ready = True
|
self.ready = True
|
||||||
return True
|
return True
|
||||||
except requests.exceptions.RequestException:
|
except requests.exceptions.RequestException:
|
||||||
@ -251,7 +251,7 @@ class LollmsXTTS:
|
|||||||
else:
|
else:
|
||||||
print("Request failed with status code:", response.status_code)
|
print("Request failed with status code:", response.status_code)
|
||||||
|
|
||||||
def tts_to_audio(self, text, speaker_wav, file_name_or_path, language="en"):
|
def tts_to_audio(self, text, speaker_wav, file_name_or_path:Path|str=None, language="en"):
|
||||||
url = f"{self.xtts_base_url}/tts_to_audio"
|
url = f"{self.xtts_base_url}/tts_to_audio"
|
||||||
|
|
||||||
# Define the request body
|
# Define the request body
|
||||||
@ -273,6 +273,7 @@ class LollmsXTTS:
|
|||||||
print("Request successful")
|
print("Request successful")
|
||||||
# You can access the response data using response.json()
|
# You can access the response data using response.json()
|
||||||
# Open a new file in binary write mode
|
# Open a new file in binary write mode
|
||||||
|
if file_name_or_path is not None:
|
||||||
with open(self.output_folder/file_name_or_path, 'wb') as file:
|
with open(self.output_folder/file_name_or_path, 'wb') as file:
|
||||||
# Write the binary content to the file
|
# Write the binary content to the file
|
||||||
file.write(response.content)
|
file.write(response.content)
|
||||||
|
Loading…
Reference in New Issue
Block a user