Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/aurelio-labs/semantic-router. Pull mirroring updated .
  1. Feb 19, 2024
  2. Feb 13, 2024
    • Siraj R Aizlewood's avatar
      Linting. · 59600647
      Siraj R Aizlewood authored
      59600647
    • Siraj R Aizlewood's avatar
      Bug Fix Saving JSON/YAML of Layer Config · 8d2de77e
      Siraj R Aizlewood authored
      Saving Layer Configs as JSON or YAML config files by representing the LayerConfig object as a dict and then turning into JSON/YAML wasn't working.
      
      See issue here: https://github.com/aurelio-labs/semantic-router/issues/144
      
      The issue was that, by attempting this, we were attempting to serialize all objects included in the Layer, including Routes, and the LLMs that those Routes use.
      
      In the case of the above issue, the LLM was a Cohere one, which included a Client as one of its attributes, and this Client is not serializable.
      
      So, instead of attempting to represent the entire LLM object a dict, to then be converted into JSON/YAML, we only keep key information about the LLM:
      
      'module': self.llm.__module__,
      'class': self.llm.__class__.__name__,
      'model': self.llm.name
      
      This is what's saved in route.py, and then sent to layer.py to be serialized (in LayerConfig.to_file()).
      
      Then, when it comes time to load from the file via LayerConfig.from_file, the LLM is re-initialized dynamically.
      8d2de77e
  3. Jan 26, 2024
  4. Jan 23, 2024
  5. Jan 22, 2024
  6. Jan 18, 2024
  7. Jan 16, 2024
  8. Jan 13, 2024
  9. Jan 12, 2024
  10. Jan 11, 2024
  11. Jan 10, 2024
  12. Jan 07, 2024
  13. Jan 06, 2024
  14. Jan 05, 2024
  15. Jan 02, 2024
  16. Dec 28, 2023
  17. Dec 27, 2023
  18. Dec 26, 2023
  19. Dec 20, 2023
  20. Dec 19, 2023
Loading