Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -18,8 +18,13 @@ whisper_processor = WhisperProcessor.from_pretrained("openai/whisper-base")
|
|
18 |
whisper_model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-base")
|
19 |
|
20 |
# Initialize the summarization model and tokenizer
|
21 |
-
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
23 |
|
24 |
# Function to transcribe audio
|
25 |
def transcribe_audio(audio_file):
|
|
|
18 |
whisper_model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-base")
|
19 |
|
20 |
# Initialize the summarization model and tokenizer
|
21 |
+
# Use a smaller version of the Llama model and load in FP16
|
22 |
+
summarization_model = AutoModelForCausalLM.from_pretrained(
|
23 |
+
"meta-llama/Llama-2-3b-hf",
|
24 |
+
torch_dtype=torch.float16,
|
25 |
+
low_cpu_mem_usage=True
|
26 |
+
)
|
27 |
+
summarization_tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-2-3b-hf")
|
28 |
|
29 |
# Function to transcribe audio
|
30 |
def transcribe_audio(audio_file):
|