()
| 187 | main_interface = gr.Column(visible=False) |
| 188 | |
| 189 | def initialize_model(): |
| 190 | try: |
| 191 | load_model() |
| 192 | return { |
| 193 | loading_status: gr.update(value="Model loaded successfully!", visible=False), |
| 194 | main_interface: gr.update(visible=True), |
| 195 | } |
| 196 | except Exception as e: |
| 197 | print(f'Failed to load model with error: {e}') |
| 198 | return { |
| 199 | loading_status: gr.update(value=f"Failed to load model: {str(e)}", visible=True), |
| 200 | main_interface: gr.update(visible=True), |
| 201 | } |
| 202 | |
| 203 | app.load(initialize_model, inputs=None, outputs=[loading_status, main_interface]) |
| 204 |
nothing calls this directly
no test coverage detected