How to fine-tune whisper on unsupported language?
While following this blog,huggingface.coFine-Tune Whisper For Multilingual ASR with 🤗 TransformersWe’re on a journey to advance and democratize artificial intelligence through open source and open science.What should I use for these lines while fine-tuning on another language which is not supported?model.generation_config.language = "hindi"
2024-10-12T04:44:00Z
There definitely seems to be a way. I’ve never tried to adjust a model, so I wouldn’t count on it…huggingface.covasista22/whisper-hindi-large-v2 · Hugging FaceWe’re on a journey to advance and democratize artificial intelligence through open source and open science.github.com/huggingface/transformersHow to set language in Whisper pipeline for audio transcription?opened05:41PM - 26 Feb 23 UTCclosed01:37PM - 27 Feb 23 UTCmelihogutcen### Problem

Hello, 

I followed this notebook for Whisper pipelines. https:…//colab.research.google.com/drive/1rS1L4YSJqKUH_3YxIQHBI982zso23wor?usp=sharing#scrollTo=Ca4YYdtATxzo

Here, I want to use speech transcription with openai/whisper-large-v2 model using the pipeline. By using WhisperProcessor, we can set the language, but this has a disadvantage for longer audio files than 30 seconds. I used the below code and I can set the language here.
```
import torch
from transformers import WhisperForConditionalGeneration, WhisperProcessor
device = "cuda" if torch.cuda.is_available() else "cpu"
model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-large-v2").to(device)
processor = WhisperProcessor.from_pretrained("openai/whisper-large-v2")
inputs = processor.feature_extractor(speech_data, return_tensors="pt", sampling_rate=16_000).input_features.to(device)
generate_ids = model.generate(inputs, max_length=480_000, language="<|tr|>", task="transcribe", return_timestamps=True)
results = processor.tokenizer.decode(generate_ids[0], decode_with_timestamps=True, output_offsets=True)
```

Long audio files can be processed in the pipeline by setting chunk_length as below. But in the pipeline, I couldn't set the language. Therefore, I have gotten English results in my Turkish speech data.
```
from transformers import pipeline
MODEL_NAME = "openai/whisper-large-v2"

pipe = pipeline(
    task="automatic-speech-recognition",
    model=MODEL_NAME,
    device='cpu')

pipe(speech_file, return_timestamps=True, chunk_length_s=30, stride_length_s=[6,0], batch_size=32)
```

Is there a way to set the language?

### System Info

docker image:

- pytorch/pytorch:1.13.1-cuda11.6-cudnn8-runtime

Transformers Version: 
`transformers==v4.27dev`



### Who can help?

@sanchit-gandhi @Narsil 

### Information

- [X] The official example scripts
- [ ] My own modified scripts

### Tasks

- [X] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction

```
from transformers import pipeline
MODEL_NAME = "openai/whisper-large-v2"

pipe = pipeline(
    task="automatic-speech-recognition",
    model=MODEL_NAME,
    device='cpu')

pipe(speech_file, return_timestamps=True, chunk_length_s=30, stride_length_s=[6,0], batch_size=32)
```

### Expected behavior

```
Label: "Bazı Türkçe kelimeler."
Prediction: "Some Turkish words."
```github.comGitHub - AI4Bharat/vistaar: Vistaar: Diverse Benchmarks and Training Sets for...Vistaar: Diverse Benchmarks and Training Sets for Indian Language ASR