Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -300,7 +300,7 @@ def api_export_artifacts():
|
|
| 300 |
zip_file.writestr('README_section.md', readme_content)
|
| 301 |
|
| 302 |
# Add Python utility script
|
| 303 |
-
python_script =
|
| 304 |
"""
|
| 305 |
Model Registration Utility
|
| 306 |
Generated by Clarifai Community Bench
|
|
@@ -316,13 +316,13 @@ class ModelArtifact:
|
|
| 316 |
self.manifest = yaml.safe_load(f)
|
| 317 |
|
| 318 |
def get_model_info(self):
|
| 319 |
-
return {
|
| 320 |
"id": self.manifest["model_id"],
|
| 321 |
"task": self.manifest["task"],
|
| 322 |
"readiness_score": self.manifest.get("readiness_score", 0),
|
| 323 |
"avg_latency": self._calculate_avg_latency(),
|
| 324 |
"best_dataset": self._get_best_performing_dataset()
|
| 325 |
-
}
|
| 326 |
|
| 327 |
def _calculate_avg_latency(self):
|
| 328 |
results = self.manifest.get("results", [])
|
|
|
|
| 300 |
zip_file.writestr('README_section.md', readme_content)
|
| 301 |
|
| 302 |
# Add Python utility script
|
| 303 |
+
python_script = '''
|
| 304 |
"""
|
| 305 |
Model Registration Utility
|
| 306 |
Generated by Clarifai Community Bench
|
|
|
|
| 316 |
self.manifest = yaml.safe_load(f)
|
| 317 |
|
| 318 |
def get_model_info(self):
|
| 319 |
+
return {
|
| 320 |
"id": self.manifest["model_id"],
|
| 321 |
"task": self.manifest["task"],
|
| 322 |
"readiness_score": self.manifest.get("readiness_score", 0),
|
| 323 |
"avg_latency": self._calculate_avg_latency(),
|
| 324 |
"best_dataset": self._get_best_performing_dataset()
|
| 325 |
+
}
|
| 326 |
|
| 327 |
def _calculate_avg_latency(self):
|
| 328 |
results = self.manifest.get("results", [])
|