palbha commited on
Commit
865f75c
·
verified ·
1 Parent(s): 433d4b6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -9,7 +9,7 @@ token = os.getenv("HF_TOKEN")
9
  login(token=token)
10
 
11
  # Whisper Model Optimization
12
- model = "openai/whisper-small"
13
  DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
14
 
15
  processor = AutoProcessor.from_pretrained(model)
@@ -24,7 +24,7 @@ transcriber = pipeline(
24
  )
25
 
26
  # LLaMA Model Optimization
27
- LLAMA = "meta-llama/Meta-Llama-3.1-8B-Instruct"
28
  llama_quant_config = BitsAndBytesConfig(
29
  load_in_4bit=True,
30
  bnb_4bit_use_double_quant=True,
@@ -47,7 +47,8 @@ def process_audio(audio_file):
47
 
48
  # Transcribe audio
49
  transcript = transcriber(audio_file)["text"]
50
-
 
51
  # Generate meeting minutes
52
  system_message = "You are an assistant that produces minutes of meetings from transcripts, with summary, key discussion points, takeaways and action items with owners, in markdown."
53
  user_prompt = f"Below is an extract transcript of a Denver council meeting. Please write minutes in markdown, including a summary with attendees, location and date; discussion points; takeaways; and action items with owners.\n{transcript}"
 
9
  login(token=token)
10
 
11
  # Whisper Model Optimization
12
+ model = "openai/whisper-tiny"
13
  DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
14
 
15
  processor = AutoProcessor.from_pretrained(model)
 
24
  )
25
 
26
  # LLaMA Model Optimization
27
+ LLAMA = "meta-llama/Llama-3.2-3B-Instruct"
28
  llama_quant_config = BitsAndBytesConfig(
29
  load_in_4bit=True,
30
  bnb_4bit_use_double_quant=True,
 
47
 
48
  # Transcribe audio
49
  transcript = transcriber(audio_file)["text"]
50
+ del transcriber
51
+ del processor
52
  # Generate meeting minutes
53
  system_message = "You are an assistant that produces minutes of meetings from transcripts, with summary, key discussion points, takeaways and action items with owners, in markdown."
54
  user_prompt = f"Below is an extract transcript of a Denver council meeting. Please write minutes in markdown, including a summary with attendees, location and date; discussion points; takeaways; and action items with owners.\n{transcript}"