mirror of https://github.com/Chocobozzz/PeerTube
Add vad_filter to ctranslate transcriber
Helps us to correctly detect the language if there is no voice in the first 30 seconds Also helps to lower hallucinationspull/6527/head
parent
fb5236f2af
commit
c289c86741
|
@ -28,7 +28,11 @@ export function getCustomModelPath (modelName: CustomModelName) {
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
export async function checkAutoCaption (servers: PeerTubeServer[], uuid: string, captionContains = 'WEBVTT\n\n00:00.000 --> 00:') {
|
export async function checkAutoCaption (
|
||||||
|
servers: PeerTubeServer[],
|
||||||
|
uuid: string,
|
||||||
|
captionContains = new RegExp('^WEBVTT\\n\\n00:00.\\d{3} --> 00:')
|
||||||
|
) {
|
||||||
for (const server of servers) {
|
for (const server of servers) {
|
||||||
const body = await server.captions.list({ videoId: uuid })
|
const body = await server.captions.list({ videoId: uuid })
|
||||||
expect(body.total).to.equal(1)
|
expect(body.total).to.equal(1)
|
||||||
|
|
|
@ -35,6 +35,8 @@ export class Ctranslate2Transcriber extends OpenaiTranscriber {
|
||||||
...modelArgs,
|
...modelArgs,
|
||||||
'--word_timestamps',
|
'--word_timestamps',
|
||||||
'True',
|
'True',
|
||||||
|
'--vad_filter',
|
||||||
|
'true',
|
||||||
'--output_format',
|
'--output_format',
|
||||||
'all',
|
'all',
|
||||||
'--output_dir',
|
'--output_dir',
|
||||||
|
|
Loading…
Reference in New Issue