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
The issue is only with python as in Java having same name for variable and function is not possible.
Code: From official website:
xBom signature:
transformers.pipelineExpected 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
Result: we detected the signature
The issue is only with
pythonas in Java having same name for variable and function is not possible.