mlbench123 commited on
Commit
32a3c77
·
verified ·
1 Parent(s): 57df2f0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -37,9 +37,12 @@ print("="*60)
37
 
38
  try:
39
  # Check if trained model files exist in root
40
- model_files = ['config.json', 'pytorch_model.bin', 'sentence_bert_config.json']
41
- has_model = all(os.path.exists(f) for f in model_files)
42
-
 
 
 
43
  if has_model:
44
  print("✓ Trained model files found in root directory")
45
  print("Loading trained model...")
 
37
 
38
  try:
39
  # Check if trained model files exist in root
40
+ # Check if trained model files exist in root
41
+ model_files = ['config.json', 'sentence_bert_config.json']
42
+ # Check for either pytorch_model.bin or model.safetensors
43
+ has_weights = os.path.exists('pytorch_model.bin') or os.path.exists('model.safetensors')
44
+ has_model = all(os.path.exists(f) for f in model_files) and has_weights
45
+
46
  if has_model:
47
  print("✓ Trained model files found in root directory")
48
  print("Loading trained model...")