mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-05-09 02:19:08 +08:00

Use `np.float32()` instead. ### What problem does this PR solve? Using `eval()` can lead to code injections. I think `eval()` is only used to parse a floating point number here. This change preserves the correct behavior if the string `"None"` is supplied. But if that behavior isn't intended then this part could be just deleted instead, since `np.float32()` is parsing strings anyway: ```Python if isinstance(scale, str): scale = eval(scale) ``` ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)