Skip to content

Instantly share code, notes, and snippets.

@raivisdejus
Last active January 7, 2025 07:27
Show Gist options
  • Save raivisdejus/07ca2e37d1fb87f81df12e424cf9175b to your computer and use it in GitHub Desktop.
Save raivisdejus/07ca2e37d1fb87f81df12e424cf9175b to your computer and use it in GitHub Desktop.
Latviesu runas atpazisana
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@EonosLovos
Copy link

EonosLovos commented Jan 7, 2025

Paldies autoram! ⭐ 👏👏👏

"eksperimentu" izdodas sekmīgi reproducēt ar cuda 12;
un mani novērojumi apstiprina, ka

1h27m un 1h32 min mp3 ar šiem parametriem
saiet 16gb vram GPU
(piemēram, autora norādītajā T4).


ja nepieciešams uz 8GB, jāmaina parametros kaut kas;
par šo nezinu, bet oriģinālajam whisper man savietojās stipri zem 8GB (bet virs 4GB) pēc viņu readme.md :

1 / 3:

low_cpu_mem_usage=True

(pie model inicializācijas)
model = AutoModelForSpeechSeq2Seq.from_pretrained(
model_id, torch_dtype=torch_dtype, low_cpu_mem_usage=FalseTrue, use_safetensors=True
).to(device)
un

2/3

generate_kwargs = {
        "max_new_tokens": 445,
    "num_beams": 1,
    "return_timestamps": True,
    "language": "latvian",
}

un

3/3

izsaucot

result = pipe('audio.flac', return_timestamps=True, generate_kwargs=generate_kwargs)

image

10 minūtes vēlāk:
image

@raivisdejus
Copy link
Author

Runas atpazīšanai savā datorā (Linux, Mac, Windows) var izmantot arī šo lietotni https://github.com/chidiwilliams/buzz/
Šī lietotne piedāvā vairākus Whisper veidus un vairākas papildu iespējas. Faster Whisper tipiski izmanto mazāku atmiņas apjomu, tas ir pieejams lietotē Buzz. Tiesa 4GB kartes lielos modeļus visdrīzāk nespēs darbināt. 8GB vajadzētu pietikt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment