Prashanthsrn commited on
Commit
502f248
·
verified ·
1 Parent(s): ae8437f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -2,6 +2,7 @@ import streamlit as st
2
  from PIL import Image
3
  import io
4
  from image_to_text import generate_caption
 
5
 
6
  def main():
7
  st.title("Image Captioning App")
@@ -21,8 +22,12 @@ def main():
21
  st.write(caption)
22
  except Exception as e:
23
  st.error(f"An error occurred while generating the caption: {str(e)}")
 
 
24
  except Exception as e:
25
  st.error(f"An error occurred while processing the image: {str(e)}")
 
 
26
 
27
  if __name__ == "__main__":
28
  main()
 
2
  from PIL import Image
3
  import io
4
  from image_to_text import generate_caption
5
+ import traceback
6
 
7
  def main():
8
  st.title("Image Captioning App")
 
22
  st.write(caption)
23
  except Exception as e:
24
  st.error(f"An error occurred while generating the caption: {str(e)}")
25
+ st.error("Detailed error traceback:")
26
+ st.code(traceback.format_exc())
27
  except Exception as e:
28
  st.error(f"An error occurred while processing the image: {str(e)}")
29
+ st.error("Detailed error traceback:")
30
+ st.code(traceback.format_exc())
31
 
32
  if __name__ == "__main__":
33
  main()