AryanSingh04 commited on
Commit
2d93393
·
verified ·
1 Parent(s): d011d82

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -33,7 +33,8 @@ WHISPER_SIZE = os.getenv("WHISPER_SIZE", "small")
33
  whisper_model = WhisperModel(WHISPER_SIZE, device="cpu", compute_type="int8")
34
 
35
  # Summarizer: compact & solid
36
- summarizer = pipeline("summarization", model="sshleifer/distilbart-cnn-12-6")
 
37
 
38
  # Title generator (tiny T5). You can switch to flan-t5-base if you upgrade hardware.
39
  title_gen = pipeline("text2text-generation", model="google/flan-t5-small")
@@ -81,9 +82,10 @@ def summarize_and_title(transcript: str) -> Tuple[str, str]:
81
 
82
  # Title
83
  title_prompt = (
84
- "Generate a short, catchy, human-friendly title (<= 10 words) for this content:\n"
85
- + summary
86
  )
 
87
  title = title_gen(title_prompt, max_new_tokens=16, num_return_sequences=1)[0]["generated_text"].strip()
88
 
89
  # Tidying
 
33
  whisper_model = WhisperModel(WHISPER_SIZE, device="cpu", compute_type="int8")
34
 
35
  # Summarizer: compact & solid
36
+ summarizer = pipeline("summarization", model="philschmid/bart-large-cnn-samsum")
37
+
38
 
39
  # Title generator (tiny T5). You can switch to flan-t5-base if you upgrade hardware.
40
  title_gen = pipeline("text2text-generation", model="google/flan-t5-small")
 
82
 
83
  # Title
84
  title_prompt = (
85
+ "Write a short, catchy YouTube-style title (<= 8 words) for this summary:\n"
86
+ f"{summary}"
87
  )
88
+
89
  title = title_gen(title_prompt, max_new_tokens=16, num_return_sequences=1)[0]["generated_text"].strip()
90
 
91
  # Tidying