Update README.md
Browse files
README.md
CHANGED
@@ -44,33 +44,18 @@ The original code repository can be found [here](https://github.com/openai/whisp
|
|
44 |
## Usage
|
45 |
|
46 |
```python
|
47 |
-
import
|
48 |
-
from transformers import
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
"automatic-speech-recognition",
|
60 |
-
model=model,
|
61 |
-
tokenizer=processor.tokenizer,
|
62 |
-
feature_extractor=processor.feature_extractor,
|
63 |
-
max_new_tokens=128,
|
64 |
-
chunk_length_s=30,
|
65 |
-
batch_size=16,
|
66 |
-
return_timestamps=True,
|
67 |
-
torch_dtype=torch_dtype,
|
68 |
-
device=device,
|
69 |
-
)
|
70 |
-
dataset = load_dataset("distil-whisper/librispeech_long", "clean", split="validation")
|
71 |
-
sample = dataset[0]["audio"]
|
72 |
-
result = pipe(sample)
|
73 |
-
print(result["text"])
|
74 |
```
|
75 |
|
76 |
## Fine-Tuning
|
|
|
44 |
## Usage
|
45 |
|
46 |
```python
|
47 |
+
import whisper
|
48 |
+
from transformers import pipeline
|
49 |
+
|
50 |
+
model_name = "Aismantas/whisper-base-lithuanian"
|
51 |
+
asr_pipeline = pipeline("automatic-speech-recognition", model=model_name)
|
52 |
+
|
53 |
+
# Assuming the file is named 'audio.wav'
|
54 |
+
audio_file = "example_1.wav"
|
55 |
+
|
56 |
+
# Run the transcription
|
57 |
+
transcription = asr_pipeline(audio_file)
|
58 |
+
print(transcription)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
```
|
60 |
|
61 |
## Fine-Tuning
|