Spaces:
Runtime error
Runtime error
acecalisto3
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1596,15 +1596,13 @@ if __name__ == "__main__":
|
|
1596 |
template_data = json.load(f)
|
1597 |
name = template_file.stem
|
1598 |
self.templates[name] = Template(**template_data)
|
1599 |
-
|
1600 |
-
|
1601 |
-
|
1602 |
-
|
1603 |
-
|
1604 |
-
return templates
|
1605 |
|
1606 |
-
|
1607 |
-
self.category_index = self._build_category_index()
|
1608 |
|
1609 |
def _build_component_index(self) -> Dict[str, List[str]]:
|
1610 |
"""Build index of templates by component"""
|
|
|
1596 |
template_data = json.load(f)
|
1597 |
name = template_file.stem
|
1598 |
self.templates[name] = Template(**template_data)
|
1599 |
+
except Exception as e:
|
1600 |
+
logger.error(f"Error loading templates: {e}")
|
1601 |
+
self.component_index = self._build_component_index()
|
1602 |
+
self.category_index = self._build_category_index()
|
1603 |
+
return templates
|
|
|
1604 |
|
1605 |
+
|
|
|
1606 |
|
1607 |
def _build_component_index(self) -> Dict[str, List[str]]:
|
1608 |
"""Build index of templates by component"""
|