garak.generators.watsonx
Interface with IBM WatsonX models/systems.
- class WatsonXGenerator(name='', config_root=<module 'garak._config' from '/home/docs/checkouts/readthedocs.org/user_builds/garak/checkouts/stable/garak/_config.py'>)Source
Bases:
GeneratorThis is a generator for watsonx.ai.
- Make sure that you initialize the environment variables:
‘WATSONX_TOKEN’, ‘WATSONX_URL’, ‘WATSONX_PROJECTID’ OR ‘WATSONX_DEPLOYID’.
To use a model that is in the “project” stage initialize the WATSONX_PROJECTID variable with the Project ID of the model. To use a tuned model that is deployed, simply initialize the WATSONX_DEPLOYID variable with the Deployment ID of the model.
Configurable parameters:
DEFAULT_PARAMScontents:max_tokens=900temperature=Nonetop_k=Nonecontext_len=Noneskip_seq_start=Noneskip_seq_end=Noneuri=Noneversion='2023-05-29'project_id=''deployment_id=''prompt_variable='input'bearer_token=''
Default values are listed
See also Configuring garak for how to set these values.
Other attributes:
- DID_ENV_VAR = 'WATSONX_DEPLOYID'
- ENV_VAR = 'WATSONX_TOKEN'
- PID_ENV_VAR = 'WATSONX_PROJECTID'
- URI_ENV_VAR = 'WATSONX_URL'
- generator_family_name = 'watsonx'