asrilmurdian commited on
Commit
383f798
·
verified ·
1 Parent(s): e25f5ce

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -6
app.py CHANGED
@@ -116,12 +116,10 @@ with st.container():
116
  # Query the API Summary
117
  output_sum = query_sum({"inputs": text, })
118
 
119
- if output_sum:
120
- # Check if the dictionary is not empty
121
- summary = output_sum[0].get('summary_text', '').replace('<n>', " ")
122
- else:
123
- # Handle the case where the dictionary is empty or doesn't have 'summary_text'
124
- summary = "Summary not available"
125
 
126
  st.divider()
127
  st.subheader("Summary AI")
 
116
  # Query the API Summary
117
  output_sum = query_sum({"inputs": text, })
118
 
119
+ if output_sum and isinstance(output_sum, list) and len(output_sum) > 0:
120
+ summary = output_sum[0].get('summary_text', '').replace('<n>', " ")
121
+ else:
122
+ summary = "Summary not available"
 
 
123
 
124
  st.divider()
125
  st.subheader("Summary AI")