cdancette commited on
Commit
44a88e8
·
1 Parent(s): 24691a6

add traceback

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -24,6 +24,7 @@ import pandas as pd
24
  import torch
25
  from datasets import Dataset
26
  from PIL import Image
 
27
 
28
  from inference import (
29
  load_curia_dataset,
@@ -453,7 +454,8 @@ def run_inference(
453
  result_text = f"**Prediction:** {prediction}"
454
  return result_text, df
455
  except Exception as exc: # pragma: no cover - surfaced in UI
456
- return f"Failed to run inference: {exc}", pd.DataFrame()
 
457
 
458
 
459
  def handle_upload_preview(
 
24
  import torch
25
  from datasets import Dataset
26
  from PIL import Image
27
+ import traceback
28
 
29
  from inference import (
30
  load_curia_dataset,
 
454
  result_text = f"**Prediction:** {prediction}"
455
  return result_text, df
456
  except Exception as exc: # pragma: no cover - surfaced in UI
457
+ traceback.print_exc()
458
+ return f"Failed to run inference: {exc}", gr.update(visible=False)
459
 
460
 
461
  def handle_upload_preview(