liloumln commited on
Commit
e3fc8c3
·
verified ·
1 Parent(s): 867080b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -13
app.py CHANGED
@@ -13,14 +13,14 @@ def process(audio_file, transcript_text, meeting_title):
13
  text = (text + "\n" + extra).strip() if text else extra
14
 
15
  if not text or len(text) < 40:
16
- return "Merci d'uploader un audio OU de coller un transcript (≥ 40 caractères).", "", [], [], None
17
 
18
  resum = summarize(text)
19
  ed = extract_actions_decisions(text)
20
  actions = ed.get("actions", [])
21
  decisions = ed.get("decisions", [])
22
 
23
- title = meeting_title or "Réunion"
24
  md = make_minutes_md(title, resum, actions, decisions)
25
  md_path = os.path.join(OUT_DIR, "minutes.md")
26
  with open(md_path, "w", encoding="utf-8") as f:
@@ -28,26 +28,26 @@ def process(audio_file, transcript_text, meeting_title):
28
 
29
  # HighlightedText expects list of (text, label). We'll tag each item.
30
  actions_ht = [(a, "Action") for a in actions] if actions else []
31
- decisions_ht = [(d, "Décision") for d in decisions] if decisions else []
32
 
33
- return "Analyse terminée ✅", resum, actions_ht, decisions_ht, md_path
34
 
35
  with gr.Blocks(title="MeetingNotes AI") as demo:
36
  gr.Markdown("# MeetingNotes AI")
37
- gr.Markdown("Chargez un **audio** ou **collez un transcript**, puis cliquez **Analyser**.")
38
 
39
  with gr.Row():
40
  with gr.Column():
41
- meeting_title = gr.Textbox(label="Titre de la réunion", value="Lancement produit — Weekly")
42
  audio = gr.Audio(label="Audio (mp3/wav)", sources=["upload"], type="filepath")
43
- transcript = gr.Textbox(label="Transcript (optionnel si audio)", lines=10, placeholder="Collez ici…")
44
- btn = gr.Button("Analyser")
45
  with gr.Column():
46
- status = gr.Textbox(label="Statut")
47
- resume = gr.Textbox(label="Résumé", lines=8)
48
- actions = gr.HighlightedText(label="Points d'action", combine_adjacent=True)
49
- decisions = gr.HighlightedText(label="Décisions prises", combine_adjacent=True)
50
- files = gr.File(label="Télécharger minutes.md")
51
 
52
  btn.click(process, inputs=[audio, transcript, meeting_title], outputs=[status, resume, actions, decisions, files])
53
 
 
13
  text = (text + "\n" + extra).strip() if text else extra
14
 
15
  if not text or len(text) < 40:
16
+ return "Please, upload an audio or paste a transcript (≥ 40 characters).", "", [], [], None
17
 
18
  resum = summarize(text)
19
  ed = extract_actions_decisions(text)
20
  actions = ed.get("actions", [])
21
  decisions = ed.get("decisions", [])
22
 
23
+ title = meeting_title or "Meeting"
24
  md = make_minutes_md(title, resum, actions, decisions)
25
  md_path = os.path.join(OUT_DIR, "minutes.md")
26
  with open(md_path, "w", encoding="utf-8") as f:
 
28
 
29
  # HighlightedText expects list of (text, label). We'll tag each item.
30
  actions_ht = [(a, "Action") for a in actions] if actions else []
31
+ decisions_ht = [(d, "Decision") for d in decisions] if decisions else []
32
 
33
+ return "Analyze finished ✅", resum, actions_ht, decisions_ht, md_path
34
 
35
  with gr.Blocks(title="MeetingNotes AI") as demo:
36
  gr.Markdown("# MeetingNotes AI")
37
+ gr.Markdown("Upload an **audio** or **paste a transcript**, then clic **Analyze**.")
38
 
39
  with gr.Row():
40
  with gr.Column():
41
+ meeting_title = gr.Textbox(label="Title of the meeting", value="Launch product — Weekly")
42
  audio = gr.Audio(label="Audio (mp3/wav)", sources=["upload"], type="filepath")
43
+ transcript = gr.Textbox(label="Transcript (optional if audio)", lines=10, placeholder="Paste here…")
44
+ btn = gr.Button("Analyze")
45
  with gr.Column():
46
+ status = gr.Textbox(label="Statu")
47
+ resume = gr.Textbox(label="Sum up", lines=8)
48
+ actions = gr.HighlightedText(label="Action Points", combine_adjacent=True)
49
+ decisions = gr.HighlightedText(label="Decisions Taken", combine_adjacent=True)
50
+ files = gr.File(label="Download minutes.md")
51
 
52
  btn.click(process, inputs=[audio, transcript, meeting_title], outputs=[status, resume, actions, decisions, files])
53