Naphat Sornwichai commited on
Commit
995e28f
·
1 Parent(s): b7496a7

update major files

Browse files
Files changed (1) hide show
  1. app.py +2 -5
app.py CHANGED
@@ -117,11 +117,8 @@ def transcribe_and_summarize(audio_file: str, youtube_url: str, progress=gr.Prog
117
  sampling_rate=16000
118
  ).input_features.to(device, dtype=torch_dtype)
119
 
120
- # Set the generation language and task for Thai transcription
121
- decoder_prompt_ids = processor.get_decoder_prompt_ids(language="th", task="transcribe")
122
-
123
- # Generate token IDs from the input features
124
- predicted_ids = model.generate(input_features, forced_decoder_ids=decoder_prompt_ids)
125
 
126
  # Decode the token IDs to text
127
  transcribed_text = processor.batch_decode(predicted_ids, skip_special_tokens=True)[0]
 
117
  sampling_rate=16000
118
  ).input_features.to(device, dtype=torch_dtype)
119
 
120
+ # Generate token IDs from the input features, passing task and language directly
121
+ predicted_ids = model.generate(input_features, language="th", task="transcribe")
 
 
 
122
 
123
  # Decode the token IDs to text
124
  transcribed_text = processor.batch_decode(predicted_ids, skip_special_tokens=True)[0]