sheikh987 commited on
Commit
3632b34
·
verified ·
1 Parent(s): c106a5b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -6
app.py CHANGED
@@ -60,14 +60,12 @@ except Exception as e:
60
 
61
  # --- Load Knowledge Base and Labels ---
62
  try:
63
- knowledge_base_path = hf_hub_download(repo_id=CLASS_REPO_ID, filename="knowledge_base.json")
64
- with open(knowledge_base_path, 'r') as f:
65
  knowledge_base = json.load(f)
66
- print("--> Knowledge base loaded from Hub.")
67
  except Exception as e:
68
- print(f"!!! ERROR loading knowledge_base.json from Hub: {e}")
69
- raise gr.Error("knowledge_base.json not found in the Hub repo. Make sure it has been uploaded.")
70
-
71
 
72
  idx_to_class_abbr = {0: 'MEL', 1: 'NV', 2: 'BCC', 3: 'AKIEC', 4: 'BKL', 5: 'DF', 6: 'VASC'}
73
 
 
60
 
61
  # --- Load Knowledge Base and Labels ---
62
  try:
63
+ with open("knowledge_base.json", 'r') as f:
 
64
  knowledge_base = json.load(f)
65
+ print("--> Knowledge base loaded from local file.")
66
  except Exception as e:
67
+ print(f"!!! ERROR loading knowledge_base.json: {e}")
68
+ raise gr.Error("knowledge_base.json not found. Make sure it has been uploaded.")
 
69
 
70
  idx_to_class_abbr = {0: 'MEL', 1: 'NV', 2: 'BCC', 3: 'AKIEC', 4: 'BKL', 5: 'DF', 6: 'VASC'}
71