palbha commited on
Commit
949bd6c
·
verified ·
1 Parent(s): fd2fb33

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -7
app.py CHANGED
@@ -3,18 +3,12 @@ import torch
3
  from transformers import pipeline, AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig, TextStreamer, AutoModelForSpeechSeq2Seq
4
 
5
  # Whisper Model Optimization
6
- WHISPER_MODEL = "openai/whisper-large-v3"
7
  DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
8
 
9
  processor = AutoProcessor.from_pretrained(MODEL_NAME)
10
 
11
- whisper_model = AutoModelForSpeechSeq2Seq.from_pretrained(
12
- WHISPER_MODEL,
13
- torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32, # Use fp16 if GPU available
14
- device_map="auto"
15
- )
16
 
17
- whisper_tokenizer = AutoTokenizer.from_pretrained(WHISPER_MODEL)
18
  transcriber = pipeline(
19
  "automatic-speech-recognition",
20
  model=model,
 
3
  from transformers import pipeline, AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig, TextStreamer, AutoModelForSpeechSeq2Seq
4
 
5
  # Whisper Model Optimization
6
+ model = "openai/whisper-small"
7
  DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
8
 
9
  processor = AutoProcessor.from_pretrained(MODEL_NAME)
10
 
 
 
 
 
 
11
 
 
12
  transcriber = pipeline(
13
  "automatic-speech-recognition",
14
  model=model,