Update app.py
Browse files
app.py
CHANGED
@@ -15,9 +15,9 @@ whisper_quant_config = BitsAndBytesConfig(
|
|
15 |
|
16 |
whisper_model = AutoModelForSpeechSeq2Seq.from_pretrained(
|
17 |
WHISPER_MODEL,
|
18 |
-
|
19 |
-
|
20 |
-
)
|
21 |
|
22 |
whisper_tokenizer = AutoTokenizer.from_pretrained(WHISPER_MODEL)
|
23 |
transcriber = pipeline(
|
@@ -39,7 +39,11 @@ llama_quant_config = BitsAndBytesConfig(
|
|
39 |
|
40 |
tokenizer = AutoTokenizer.from_pretrained(LLAMA)
|
41 |
tokenizer.pad_token = tokenizer.eos_token
|
42 |
-
model = AutoModelForCausalLM.from_pretrained(
|
|
|
|
|
|
|
|
|
43 |
|
44 |
# Function to Transcribe & Generate Minutes
|
45 |
def process_audio(audio_file):
|
|
|
15 |
|
16 |
whisper_model = AutoModelForSpeechSeq2Seq.from_pretrained(
|
17 |
WHISPER_MODEL,
|
18 |
+
torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32, # Use fp16 if GPU available
|
19 |
+
device_map="auto"
|
20 |
+
)
|
21 |
|
22 |
whisper_tokenizer = AutoTokenizer.from_pretrained(WHISPER_MODEL)
|
23 |
transcriber = pipeline(
|
|
|
39 |
|
40 |
tokenizer = AutoTokenizer.from_pretrained(LLAMA)
|
41 |
tokenizer.pad_token = tokenizer.eos_token
|
42 |
+
model = AutoModelForCausalLM.from_pretrained(
|
43 |
+
LLAMA,
|
44 |
+
torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
|
45 |
+
device_map="auto"
|
46 |
+
)
|
47 |
|
48 |
# Function to Transcribe & Generate Minutes
|
49 |
def process_audio(audio_file):
|