| 913 | return len(self._spec.description.functions) > 0 |
| 914 | |
| 915 | def _get_function_description( |
| 916 | self, function_name: str |
| 917 | ) -> "_proto.Model_pb2.FunctionDescription": |
| 918 | f = list(filter(lambda f: f.name == function_name, self._spec.description.functions)) |
| 919 | |
| 920 | if len(f) == 0: |
| 921 | raise ValueError(f"function_name {function_name} not found in the model.") |
| 922 | |
| 923 | assert len(f) == 1, f"Invalid proto: two functions with the same name {function_name}." |
| 924 | |
| 925 | return f[0] |
| 926 | |
| 927 | def make_state(self) -> MLState: |
| 928 | """ |