acecalisto3 commited on
Commit
f5efb0b
·
verified ·
1 Parent(s): 091fd44

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -8
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
- except Exception as e:
1600
- logger.error(f"Error loading templates: {e}")
1601
-
1602
- self.component_index = self._build_component_index()
1603
- self.category_index = self._build_category_index()
1604
- return templates
1605
 
1606
- self.component_index = self._build_component_index()
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"""