englissi commited on
Commit
805ef56
β€’
1 Parent(s): 0c9ff6e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -3,10 +3,10 @@ import torch
3
  from transformers import AutoProcessor, AutoModelForCTC
4
  import soundfile as sf # For handling audio input
5
 
6
- # Load the processor and model directly for Bulgarian ASR
7
- processor = AutoProcessor.from_pretrained("infinitejoy/wav2vec2-large-xls-r-300m-bulgarian")
8
- model = AutoModelForCTC.from_pretrained("infinitejoy/wav2vec2-large-xls-r-300m-bulgarian")
9
-
10
 
11
  # ASR λ³€ν™˜ ν•¨μˆ˜ (speech-to-text conversion)
12
  def asr_generate(audio):
 
3
  from transformers import AutoProcessor, AutoModelForCTC
4
  import soundfile as sf # For handling audio input
5
 
6
+ # Load model directly
7
+ from transformers import AutoTokenizer, AutoModelForPreTraining
8
+ tokenizer = AutoTokenizer.from_pretrained("Opit/mms_tts_bulgarian_finetuning")
9
+ model = AutoModelForPreTraining.from_pretrained("Opit/mms_tts_bulgarian_finetuning")
10
 
11
  # ASR λ³€ν™˜ ν•¨μˆ˜ (speech-to-text conversion)
12
  def asr_generate(audio):