Hello guys, Recently, I am using rasa to develop a chatbot,but I encountered a technical problem. I read DIETClassifier source code,I found i can;t save it as Tf-serving model format. anybody konws how to save it as Tf-serving model format?
"self.model.save(str(tf_model_file))"
def persist(self, file_name: Text, model_dir: Text) -> Dict[Text, Any]:
"""Persist this model into the passed directory.
Return the metadata necessary to load the model again.
"""
if self.model is None:
return {"file": None}
model_dir = Path(model_dir)
tf_model_file = model_dir / f"{file_name}.tf_model"
io_utils.create_directory_for_file(tf_model_file)
self.model.save(str(tf_model_file))
io_utils.pickle_dump(
model_dir / f"{file_name}.data_example.pkl", self._data_example
)
io_utils.pickle_dump(
model_dir / f"{file_name}.label_data.pkl", self._label_data
)
io_utils.json_pickle(
model_dir / f"{file_name}.index_label_id_mapping.pkl",
self.index_label_id_mapping,
)
entity_tag_specs = (
[tag_spec._asdict() for tag_spec in self._entity_tag_specs]
if self._entity_tag_specs
else []
)
io_utils.dump_obj_as_json_to_file(
model_dir / f"{file_name}.entity_tag_specs.json", entity_tag_specs
)
return {"file": file_name}