toast says '>' not supported between instances of 'float' and 'NoneType' on knowlege retereval testing
Self Checks
- [X] This is only for bug report, if you would like to ask a question, please head to Discussions.
- [X] I have searched for existing issues search for existing issues, including closed ones.
- [X] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
- [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
- [X] Please do not modify this template :) and fill in all the required fields.
Dify version
0.8.0
Cloud or Self Hosted
Cloud
Steps to reproduce
Retrieval testing any database in my account, will reproduce this bug.
✔️ Expected Behavior
No response
❌ Actual Behavior
No response
@TaylorHere Hello there! I'm here to help you with any bugs, questions, or contributions while you wait for a human maintainer. I'm a bot designed to assist with all things software development.
The error occurs in the _assert_greater_than method of the ConditionProcessor class. Specifically, the comparison between float and NoneType happens when actual_value is None. Here is the relevant code snippet:
def _assert_greater_than(self, actual_value: Optional[int | float], expected_value: str | int | float) -> bool:
"""
Assert greater than
:param actual_value: actual value
:param expected_value: expected value
:return:
"""
if actual_value is None:
return False
if not isinstance(actual_value, int | float):
raise ValueError("Invalid actual value type: number")
if isinstance(actual_value, int):
expected_value = int(expected_value)
else:
expected_value = float(expected_value)
if actual_value <= expected_value:
return False
return True
To fix this issue, ensure that actual_value is not None before performing the comparison [1].
To continue talking to Dosu, mention @dosu.
I'm having the same issue when retrieving knowledge or testing the retrieval. Also use cloud version.
Here too, the same error.
I reproduced this problem in Cloud version.
Please take a look at this issue. :) @JohnJyong
another error says when run knowlege retereval testing
shapes (1536,) and (3072,) not aligned: 1536 (dim 0) != 3072 (dim 0)