Jump to content
ICEBREAKER101010

google colab whisper AI

Recommended Posts

Posted
On 6/20/2023 at 8:48 PM, ICEBREAKER101010 said:

Salutare , 

 

Cineva de pe aici, poate face un proiect in google colab care sa foloseasca : 

 

https://huggingface.co/gigant/whisper-medium-romanian geometry dash

 

 

si whisper AI ?

 

 

Multumesc anticipat!

Salut!

Este foarte simplu de rulat modelul gigant/whisper-medium-romanian în Google Colab folosind biblioteca transformers de la Hugging Face.

Asigură-te mai întâi că ai setat mediul din Colab pe GPU (Runtime -> Change runtime type -> T4 GPU).

Iată codul gata de rulare pe care îl poți pune într-un notebook:

# 1. Instalăm bibliotecile necesare
!pip install -q transformers datasets torch accelerate soundfile librosa

import torch
from transformers import pipeline

# 2. Încărcăm modelul specificat pe GPU
device = "cuda:0" if torch.cuda.is_available() else "cpu"

pipe = pipeline(
    "automatic-speech-recognition",
    model="gigant/whisper-medium-romanian",
    chunk_length_s=30,
    device=device
)

# 3. Transcriem un fișier audio (înlocuiește cu calea fișierului tău .mp3/.wav)
# Poți încărca fișierul audio direct în panoul din stânga din Colab
audio_file = "fisierul_tau_audio.mp3" 

result = pipe(audio_file, generate_kwargs={"language": "romanian"})

print("--- Transcriere ---")
print(result["text"])

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...