openllmetry icon indicating copy to clipboard operation
openllmetry copied to clipboard

Fix TypeError: '<' not supported between instances of 'NoneType' and 'int' in embeddings_wrappers.py

Open kowshik24 opened this issue 1 year ago • 2 comments

This pull request fixes the issue where a TypeError occurs due to a comparison between NoneType and int The error was happening in the _set_embeddings_metrics function when recording token counts. The fix ensures that None values are handled appropriately by logging an error and skipping the recording.

Issue Reference: Fixes #1044

Changes Made:

Added a check to handle None values in the usage dictionary. Logged an error message when a None value is encountered.

kowshik24 avatar Aug 12 '24 20:08 kowshik24

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Aug 12 '24 20:08 CLAassistant

@nirga yeah sure! on it.

kowshik24 avatar Aug 13 '24 09:08 kowshik24

Thanks @kowshik24! Great work :)

nirga avatar Aug 15 '24 19:08 nirga

@kowshik24 can you look into the lint issues?

nirga avatar Aug 15 '24 19:08 nirga

@nirga linting done! Can you please check?

kowshik24 avatar Aug 15 '24 20:08 kowshik24

@kowshik24 still seems to fail. Make sure to run locally nx run-many -t lint

nirga avatar Aug 15 '24 20:08 nirga