aasherkamal216 commited on
Commit
103af67
·
unverified ·
1 Parent(s): 391db27

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -577,10 +577,13 @@ else:
577
  elif not validators.url(url):
578
  st.error("Please enter a valid URL")
579
  else:
580
- with st.spinner("Summarizing..."):
581
- final_response = summarizer_model(model_params=model_params, api_key=groq_api_key, url=url)
582
- st.markdown(final_response)
583
- st.session_state.groq_chat_history.append({"role": "assistant", "content": final_response})
 
 
 
584
 
585
  ###----- User Question -----###
586
  else:
 
577
  elif not validators.url(url):
578
  st.error("Please enter a valid URL")
579
  else:
580
+ try:
581
+ with st.spinner("Summarizing..."):
582
+ final_response = summarizer_model(model_params=model_params, api_key=groq_api_key, url=url)
583
+ st.markdown(final_response)
584
+ st.session_state.groq_chat_history.append({"role": "assistant", "content": final_response})
585
+ except Exception as e:
586
+ st.error(f"An error occurred: {e}")
587
 
588
  ###----- User Question -----###
589
  else: