Getting the error when I try to evaluate quality, risk and safety metrics in Azure AI Studio.

2024-09-26T21:26:51.1433333+00:00

Getting error : "unsupported operand type(s) for +: 'NoneType' and 'NoneType'", when calculating quality, risk and safety metrics in Azure AI Studio. This worked fine until last week, facing errors from the previous 2-3 days.

Azure AI Search
Azure AI Search
An Azure search service with built-in artificial intelligence capabilities that enrich information to help identify and explore relevant content at scale.
1,060 questions
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
2,895 questions
Azure AI Content Safety
Azure AI Content Safety
An Azure service that enables users to identify content that is potentially offensive, risky, or otherwise undesirable. Previously known as Azure Content Moderator.
20 questions
0 comments No comments
{count} votes

Accepted answer
  1. YutongTie-MSFT 52,686 Reputation points
    2024-10-01T01:08:14.9033333+00:00

    Hello Kolla, Srinivasa Arudra Phani Bhushan

    Thanks for reporting this issue, product team has acknowledged this issue and working on a fix. Will update here again if the issue has any progress.

    At this moment, please try the workaround to disable tracing and redeploy the flow by setting the env var "PF_DISABLE_TRACING" to true, this can avoid the potential error.

    os.environ['PF_DISABLE_TRACING'] = 'true'
    

    I hope this helps!

    Regards,

    Yutong

    -Please kindly accept the answer if you feel helpful to support the community, thanks a lot.


1 additional answer

Sort by: Most helpful
  1. Sina Salam 12,011 Reputation points
    2024-09-26T22:40:49.6466667+00:00

    Hello Kolla, Srinivasa Arudra Phani Bhushan,

    Welcome to the Microsoft Q&A and thank you for posting your questions here.

    I understand that you are having "unsupported operand type(s) for +: 'NoneType' and 'NoneType'", error.

    The error message "unsupported operand type(s) for +: 'NoneType' and 'NoneType'" indicates that you’re trying to perform an addition operation on variables that are None, which typically means that the values you're working with haven't been properly initialized or calculated.

    If a variable can legitimately be None, consider providing a default value such as:

       quality = quality or 0
       risk = risk or 0
       safety = safety or 0
       total = quality + risk + safety
    

    Implement error handling to gracefully manage scenarios where the values are None similar to:

       try:
           total = quality + risk + safety
       except TypeError:
           total = 0  # or handle it in another way
    

    I hope this is helpful! Do not hesitate to let me know if you have any other questions.


    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.