Spaces:
Sleeping
Sleeping
Hjgugugjhuhjggg
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -209,7 +209,13 @@ class S3DirectStream:
|
|
209 |
try:
|
210 |
api = HfApi()
|
211 |
model_info = api.model_info(model_prefix)
|
212 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|