xbom
xbom copied to clipboard
[python]: signature not matching for code having both variable and function name same.
Code: From official website:
from transformers import pipeline
pipeline = pipeline(task="text-generation", model="google/gemma-2-2b")
pipeline("the secret to baking a really good cake is ")
[{'generated_text': 'the secret to baking a really good cake is 1. the right ingredients 2. the'}]
xBom signature: transformers.pipeline
Expected Behaviour: Should detect the signature
Acutal behaviour: since pipeline (the variable) = pipeline(...) (the function) call, having conflict with name (although, valid python code), our xbom is not able to match the signature.
Fix: use different variable name
from transformers import pipeline
workflow = pipeline(task="text-generation", model="google/gemma-2-2b")
workflow("the secret to baking a really good cake is ")
[{'generated_text': 'the secret to baking a really good cake is 1. the right ingredients 2. the'}]
Result: we detected the signature