-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error while setting up offline-tts on Windows 10 #488
Comments
The problem is "wget" command which is not avaliable on windows sistem. Instead we can use de command "curl" with -o and -L option. After some researches I figured out that the I tried to execute the curl command with -O and -L parameters, as mentioned before, but I got a couple of errors. Finally the modified code in "scripts/setup-offline/run-setup-tts.js" should be: import`` fs from 'node:fs'
import { command } from 'execa'
import { LogHelper } from '@/helpers/log-helper'
import { SystemHelper } from '@/helpers/system-helper'
/**
* Set up offline text-to-speech
*/
export default () =>
new Promise(async (resolve, reject) => {
LogHelper.info('Setting up offline text-to-speech...')
const destFliteFolder = 'bin/flite'
const tmpDir = 'scripts/tmp'
let makeCores = ''
if (SystemHelper.getNumberOfCPUCores() > 2) {
makeCores = `-j ${SystemHelper.getNumberOfCPUCores() - 2}`
}
let downloader = 'wget'
if (SystemHelper.getInformation().type === 'macos') {
downloader = 'curl -L -O'
} else if (SystemHelper.getInformation().type === 'windows') { // this is the added block for windows curl command
downloader = 'curl -O --ssl-no-revok'
}
if (!fs.existsSync(`${destFliteFolder}/flite`)) {
try {
LogHelper.info('Downloading run-time synthesis engine...')
await command(
`cd ${tmpDir} && ${downloader} http://ports.ubuntu.com/pool/universe/f/flite/flite_2.1-release.orig.tar.bz2`,
{ shell: true }
)
LogHelper.success('Run-time synthesis engine download done')
LogHelper.info('Unpacking...')
await command(
`cd ${tmpDir} && tar xfvj flite_2.1-release.orig.tar.bz2 && cp ../assets/leon.lv flite-2.1-release/config`,
{ shell: true }
)
LogHelper.success('Unpack done')
LogHelper.info('Configuring...')
await command(
`cd ${tmpDir}/flite-2.1-release && ./configure --with-langvox=leon`,
{ shell: true }
)
LogHelper.success('Configure done')
LogHelper.info('Building...')
await command(`cd ${tmpDir}/flite-2.1-release && make ${makeCores}`, {
shell: true
})
LogHelper.success('Build done')
LogHelper.info('Cleaning...')
await command(
`cp -f ${tmpDir}/flite-2.1-release/bin/flite ${destFliteFolder} && rm -rf ${tmpDir}/flite-2.1-release*`,
{ shell: true }
)
LogHelper.success('Clean done')
LogHelper.success('Offline text-to-speech installed')
resolve()
} catch (e) {
LogHelper.error(`Failed to install offline text-to-speech: ${e}`)
reject(e)
}
} else {
LogHelper.success('Offline text-to-speech is already installed')
resolve()
}
}) curl check revocation error on stackoverflow: |
After replacing scripts/setup-offline/run-setup-tts.js with the above code, I now get this error:
Evidently the Windows TTS script also needs a rewrite, as I get:
...so the same wget problem. |
One thing I'm fairly sure is wrong is that there shouldn't be the two ''s after the first 'import' in the script. I removed those and tried again. This time I get: c:\Users\User1.leon\scripts\setup-offline>npm run setup:offline-tts
and that's it. When I try to do leon start again I still get: .: TTS :. .: FLITE TTS SYNTHESIZER :. |
I then went back to another doc page here: https://docs.getleon.ai/1.0.0-beta.4/offline And so I ran:
ℹ️ Checking OS environment... c:\Users\User1.leon\scripts\setup-offline> So is it actually not supported yet? Thanks for all your hard work on Leon! |
Specs
.: REPORT :.
ℹ️ Here is the diagnosis about your current setup
✅ Run
✅ Run skills
✅ Reply you by texting
✅ Start the TCP server
✅ Hooray! Leon can run correctly
ℹ️ If you have some yellow warnings, it is all good. It means some entities are not yet configured
Expected Behavior
Should Install offline tts
Actual Behavior
Got this error:
leon>npm run setup:offline-tts
ℹ️ Setting up offline text-to-speech...
ℹ️ Downloading run-time synthesis engine...
🚨 Failed to install offline text-to-speech: Error: Command failed with exit code 1: cd scripts/tmp && wget http://ports.ubuntu.com/pool/universe/f/flite/flite_2.1-release.orig.tar.bz2
'wget' is not recognized as an internal or external command,
operable program or batch file.
🚨 Failed to set up offline TTS: Error: Command failed with exit code 1: cd scripts/tmp && wget http://ports.ubuntu.com/pool/universe/f/flite/flite_2.1-release.orig.tar.bz2
'wget' is not recognized as an internal or external command,
operable program or batch file.
How Do We Reproduce?
Try installing on Windows 10
Extra (like a sample repo to reproduce the issue, etc.)
The text was updated successfully, but these errors were encountered: