neulab / ExplainaBoard

Interpretable Evaluation for AI Systems
MIT License
359 stars 36 forks source link

Avoid serializing functions #467

Open odashi opened 2 years ago

odashi commented 2 years ago

Current serialization attempt to serialize functions via inspect.getsource:

https://github.com/neulab/ExplainaBoard/blob/df48ff1792bd912087ba644cae695181e6f26e67/explainaboard/serialization/legacy.py#L26-L27

However, this function supports only limited cases: given callables have to be represented as a substantial source, and builtin/synthesized functions can't be supported. Basically we don't have complete way to serialize functions.

In addition, storing runnable code to loadable data is dangerous because it opens a door to attack the system. If we don't have any special demands, it is better to avoid this functionality from the codebase.

RFC: @neubig

neubig commented 2 years ago

I think that's fine. This serialization was more for reference, and I never intended the code to be deserialized and used.

odashi commented 2 years ago

Is there no utilization of this feature? If so we can just remove this.

neubig commented 1 year ago

Yeah, I think it can be removed for now.