newoz commited on
Commit
a856858
·
1 Parent(s): 6962cd0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -37,7 +37,11 @@ if uploaded_file is not None:
37
  st.subheader("Longs paragraphes du PDF avec résumé:")
38
  for i, paragraphe in enumerate(longs_paragraphes, start=1):
39
  summary = summarizer(paragraphe, max_length=600, min_length=30, do_sample=False)
40
- if summary and len(summary) > 0 and 'summary_text' in summary[0]:
41
- st.text(f"Paragraphe {i}: {summary[0]['summary_text']}")
 
 
 
 
42
  else:
43
  st.text(f"Paragraphe {i}: Résumé indisponible")
 
37
  st.subheader("Longs paragraphes du PDF avec résumé:")
38
  for i, paragraphe in enumerate(longs_paragraphes, start=1):
39
  summary = summarizer(paragraphe, max_length=600, min_length=30, do_sample=False)
40
+ if isinstance(summary, list) and summary:
41
+ summary_text = summary[0].get("summary_text")
42
+ if summary_text:
43
+ st.text(f"Paragraphe {i}: {summary_text}")
44
+ else:
45
+ st.text(f"Paragraphe {i}: Résumé indisponible")
46
  else:
47
  st.text(f"Paragraphe {i}: Résumé indisponible")