Skip to content

Commit

Permalink
Merge pull request OpenInterpreter#175 from dheavy/fix/tts-install-ma…
Browse files Browse the repository at this point in the history
…c-asset-url-unboundlocalerror

Fix UnboundLocalError for asset_url on Piper install (macOS)
  • Loading branch information
tyfiero authored Mar 28, 2024
2 parents 2d3c3fd + 5f35f68 commit c819eba
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions software/source/server/services/tts/piper/tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ def install(self, service_directory):
os.makedirs(PIPER_FOLDER_PATH, exist_ok=True)

# Determine OS and architecture
OS = platform.system()
OS = platform.system().lower()
ARCH = platform.machine()
if OS == "Darwin":
if OS == "darwin":
OS = "macos"
if ARCH == "arm64":
ARCH = "aarch64"
Expand All @@ -47,7 +47,7 @@ def install(self, service_directory):
else:
print("Piper: unsupported architecture")
return
elif OS == "Windows":
elif OS == "windows":
if ARCH == "AMD64":
ARCH = "amd64"
else:
Expand All @@ -58,7 +58,9 @@ def install(self, service_directory):
PIPER_URL = "https://github.com/rhasspy/piper/releases/latest/download/"

asset_url = f"{PIPER_URL}{PIPER_ASSETNAME}"
if OS == "Windows":

if OS == "windows":

asset_url = asset_url.replace(".tar.gz", ".zip")

# Download and extract Piper
Expand Down

0 comments on commit c819eba

Please sign in to comment.