Skip to content

Commit

Permalink
add yukumo and tiktok voices for TTS
Browse files Browse the repository at this point in the history
  • Loading branch information
naeruru committed Jul 22, 2024
1 parent 5336a0b commit 5949d08
Show file tree
Hide file tree
Showing 14 changed files with 784 additions and 44 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
node-version: 20.x

- name: Install Dependencies
run: npm install
Expand Down
2 changes: 1 addition & 1 deletion electron/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,4 +229,4 @@ ipcMain.on('transformers-translate', async (event, args) => {
// transformersWorker.postMessage({ type: 'transformers-translate', data: args })
const translator = new TranslationPipeline()
translator.translate(win, args)
})
})
15 changes: 8 additions & 7 deletions electron/main/modules/transformers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// see: https://github.com/xenova/transformers.js
import { PipelineType, pipeline } from '@xenova/transformers'
import type { PipelineType } from '@xenova/transformers'
import { pipeline } from '@xenova/transformers'

export class TranslationPipeline {
static task: PipelineType = 'translation'
Expand All @@ -16,15 +17,15 @@ export class TranslationPipeline {
async translate(win: any, data: any) {
// call translator. downloads and caches model if first load
const translator = await TranslationPipeline.getInstance((x: any) => {
// self.postMessage(x)
win.webContents.send('transformers-translate-render', x)
// self.postMessage(x)
win.webContents.send('transformers-translate-render', x)
})

// console.log(data)
const output = await translator(data.text, {
tgt_lang: data.tgt_lang,
src_lang: data.src_lang,

// partial outputs
callback_function: (x: any) => {
win.webContents.send('transformers-translate-render', {
Expand All @@ -34,7 +35,7 @@ export class TranslationPipeline {
})
},
})

// send back to main thread
win.webContents.send('transformers-translate-render', {
status: 'complete',
Expand Down Expand Up @@ -70,4 +71,4 @@ export class TranslationPipeline {
// output,
// index: event.data.index,
// })
// })
// })
17 changes: 8 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"pinia": "^2.1.7",
"roboto-fontface": "^0.10.0",
"vue-i18n": "^9.13.1",
"vue-router": "^4.3.2",
"vuetify": "^3.6.5",
"vue-router": "^4.4.0",
"vuetify": "^3.6.13",
"webfontloader": "^1.6.28",
"ws": "^8.17.0"
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/Footer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</v-btn>
</template>
</v-snackbar>
<v-footer app class="d-flex flex-column pl-2" height="60" permanent fixed>
<v-footer app class="d-flex flex-column pl-2" height="55" permanent fixed>
<div class="d-flex w-100 align-center">
<v-form
class="d-flex w-100 align-center"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
class="text-subtitle-1"
>
{{ $t('settings.connections.wh.description') }}
<v-col>
<code>=> { transcript: 'text here' }</code>
</v-col>
</label>
</v-col>
<v-col :cols="12" class="pt-2">
Expand Down
Loading

0 comments on commit 5949d08

Please sign in to comment.