Hjgugugjhuhjggg commited on
Commit
f58e444
·
verified ·
1 Parent(s): e58c8bb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -209,7 +209,13 @@ class S3DirectStream:
209
  try:
210
  api = HfApi()
211
  model_info = api.model_info(model_prefix)
212
- return model_info.default_revision
 
 
 
 
 
 
213
  except Exception as e:
214
  logger.error(f"Error getting latest revision for {model_prefix}: {e}")
215
  return None
 
209
  try:
210
  api = HfApi()
211
  model_info = api.model_info(model_prefix)
212
+ revision = model_info.revision
213
+ if revision:
214
+ return revision
215
+ else:
216
+ logger.warning(f"No default revision found for {model_prefix}, using 'main'")
217
+ return "main"
218
+
219
  except Exception as e:
220
  logger.error(f"Error getting latest revision for {model_prefix}: {e}")
221
  return None