mgbam commited on
Commit
8f8115b
·
verified ·
1 Parent(s): 560101b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -56
app.py CHANGED
@@ -59,62 +59,6 @@ logger.info("--- RadVision AI Application Start ---")
59
  logger.info(f"Streamlit Version: {st.__version__}")
60
  logger.info(f"Logging Level: {LOG_LEVEL}")
61
 
62
- # <<< START DEBUG CODE >>>
63
- import pkg_resources # Or importlib.metadata if Python >= 3.8
64
- import inspect
65
-
66
- st.subheader("Runtime Environment Debug Info")
67
- logger.info("--- STARTING RUNTIME ENVIRONMENT CHECK ---")
68
-
69
- st.write(f"**Python Executable:** `{sys.executable}`")
70
- logger.info(f"Runtime Python Executable: {sys.executable}")
71
- st.write(f"**Working Directory:** `{os.getcwd()}`")
72
- logger.info(f"Runtime Working Directory: {os.getcwd()}")
73
- # st.write(f"**sys.path:**") # Can be very long, log instead
74
- # st.code(str(sys.path))
75
- logger.info(f"Runtime sys.path: {sys.path}")
76
-
77
- try:
78
- # Check deep-translator version and location
79
- dt_version = "Not Found"
80
- dt_location = "Not Found"
81
- try:
82
- # Use pkg_resources (older Python) or importlib.metadata (newer)
83
- dt_version = pkg_resources.get_distribution("deep-translator").version
84
- # Alternative for Python 3.8+
85
- # from importlib.metadata import version
86
- # dt_version = version("deep-translator")
87
- except Exception as e_ver:
88
- dt_version = f"Error getting version: {e_ver}"
89
-
90
- try:
91
- import deep_translator
92
- dt_location = os.path.dirname(inspect.getfile(deep_translator))
93
- except ImportError:
94
- dt_location = "Import failed"
95
- except Exception as e_loc:
96
- dt_location = f"Error getting location: {e_loc}"
97
-
98
- st.write(f"**Deep Translator:** Version `{dt_version}`, Location: `{dt_location}`")
99
- logger.info(f"Runtime deep-translator: Version={dt_version}, Location={dt_location}")
100
-
101
- # Explicitly try to import the problematic name
102
- from deep_translator.exceptions import BadSourceLanguage
103
- st.success("`BadSourceLanguage` imported successfully in runtime check.")
104
- logger.info("`BadSourceLanguage` imported successfully in runtime check.")
105
-
106
- except ImportError as e_imp:
107
- st.error(f"IMPORT ERROR during runtime check: {e_imp}")
108
- logger.error(f"IMPORT ERROR during runtime check: {e_imp}")
109
- except Exception as e_gen:
110
- st.error(f"GENERAL ERROR during runtime check: {e_gen}")
111
- logger.error(f"GENERAL ERROR during runtime check: {e_gen}", exc_info=True)
112
-
113
- logger.info("--- COMPLETED RUNTIME ENVIRONMENT CHECK ---")
114
- st.write("--- End Debug Info ---")
115
- # <<< END DEBUG CODE >>>
116
-
117
-
118
  # --- Streamlit Drawable Canvas ---
119
  try:
120
  from streamlit_drawable_canvas import st_canvas
 
59
  logger.info(f"Streamlit Version: {st.__version__}")
60
  logger.info(f"Logging Level: {LOG_LEVEL}")
61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  # --- Streamlit Drawable Canvas ---
63
  try:
64
  from streamlit_drawable_canvas import st_canvas