Argilla
zenml.integrations.argilla
Initialization of the Argilla integration.
Attributes
ARGILLA = 'argilla'
module-attribute
ARGILLA_ANNOTATOR_FLAVOR = 'argilla'
module-attribute
Classes
ArgillaIntegration
Bases: Integration
Definition of Argilla integration for ZenML.
Functions
flavors() -> List[Type[Flavor]]
classmethod
Declare the stack component flavors for the Argilla integration.
Returns:
Type | Description |
---|---|
List[Type[Flavor]]
|
List of stack component flavors for this integration. |
Source code in src/zenml/integrations/argilla/__init__.py
32 33 34 35 36 37 38 39 40 41 42 43 |
|
Flavor
Class for ZenML Flavors.
Attributes
config_class: Type[StackComponentConfig]
abstractmethod
property
Returns StackComponentConfig
config class.
Returns:
Type | Description |
---|---|
Type[StackComponentConfig]
|
The config class. |
config_schema: Dict[str, Any]
property
The config schema for a flavor.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
The config schema. |
docs_url: Optional[str]
property
A url to point at docs explaining this flavor.
Returns:
Type | Description |
---|---|
Optional[str]
|
A flavor docs url. |
implementation_class: Type[StackComponent]
abstractmethod
property
Implementation class for this flavor.
Returns:
Type | Description |
---|---|
Type[StackComponent]
|
The implementation class for this flavor. |
logo_url: Optional[str]
property
A url to represent the flavor in the dashboard.
Returns:
Type | Description |
---|---|
Optional[str]
|
The flavor logo. |
name: str
abstractmethod
property
The flavor name.
Returns:
Type | Description |
---|---|
str
|
The flavor name. |
sdk_docs_url: Optional[str]
property
A url to point at SDK docs explaining this flavor.
Returns:
Type | Description |
---|---|
Optional[str]
|
A flavor SDK docs url. |
service_connector_requirements: Optional[ServiceConnectorRequirements]
property
Service connector resource requirements for service connectors.
Specifies resource requirements that are used to filter the available service connector types that are compatible with this flavor.
Returns:
Type | Description |
---|---|
Optional[ServiceConnectorRequirements]
|
Requirements for compatible service connectors, if a service |
Optional[ServiceConnectorRequirements]
|
connector is required for this flavor. |
type: StackComponentType
abstractmethod
property
Functions
from_model(flavor_model: FlavorResponse) -> Flavor
classmethod
Loads a flavor from a model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
flavor_model
|
FlavorResponse
|
The model to load from. |
required |
Raises:
Type | Description |
---|---|
CustomFlavorImportError
|
If the custom flavor can't be imported. |
ImportError
|
If the flavor can't be imported. |
Returns:
Type | Description |
---|---|
Flavor
|
The loaded flavor. |
Source code in src/zenml/stack/flavor.py
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
|
generate_default_docs_url() -> str
Generate the doc urls for all inbuilt and integration flavors.
Note that this method is not going to be useful for custom flavors, which do not have any docs in the main zenml docs.
Returns:
Type | Description |
---|---|
str
|
The complete url to the zenml documentation |
Source code in src/zenml/stack/flavor.py
206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
|
generate_default_sdk_docs_url() -> str
Generate SDK docs url for a flavor.
Returns:
Type | Description |
---|---|
str
|
The complete url to the zenml SDK docs |
Source code in src/zenml/stack/flavor.py
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 |
|
to_model(integration: Optional[str] = None, is_custom: bool = True) -> FlavorRequest
Converts a flavor to a model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
integration
|
Optional[str]
|
The integration to use for the model. |
None
|
is_custom
|
bool
|
Whether the flavor is a custom flavor. |
True
|
Returns:
Type | Description |
---|---|
FlavorRequest
|
The model. |
Source code in src/zenml/stack/flavor.py
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 |
|
Integration
Base class for integration in ZenML.
Functions
activate() -> None
classmethod
Abstract method to activate the integration.
Source code in src/zenml/integrations/integration.py
175 176 177 |
|
check_installation() -> bool
classmethod
Method to check whether the required packages are installed.
Returns:
Type | Description |
---|---|
bool
|
True if all required packages are installed, False otherwise. |
Source code in src/zenml/integrations/integration.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
|
flavors() -> List[Type[Flavor]]
classmethod
Abstract method to declare new stack component flavors.
Returns:
Type | Description |
---|---|
List[Type[Flavor]]
|
A list of new stack component flavors. |
Source code in src/zenml/integrations/integration.py
179 180 181 182 183 184 185 186 |
|
get_requirements(target_os: Optional[str] = None, python_version: Optional[str] = None) -> List[str]
classmethod
Method to get the requirements for the integration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target_os
|
Optional[str]
|
The target operating system to get the requirements for. |
None
|
python_version
|
Optional[str]
|
The Python version to use for the requirements. |
None
|
Returns:
Type | Description |
---|---|
List[str]
|
A list of requirements. |
Source code in src/zenml/integrations/integration.py
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 |
|
get_uninstall_requirements(target_os: Optional[str] = None) -> List[str]
classmethod
Method to get the uninstall requirements for the integration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target_os
|
Optional[str]
|
The target operating system to get the requirements for. |
None
|
Returns:
Type | Description |
---|---|
List[str]
|
A list of requirements. |
Source code in src/zenml/integrations/integration.py
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
|
plugin_flavors() -> List[Type[BasePluginFlavor]]
classmethod
Abstract method to declare new plugin flavors.
Returns:
Type | Description |
---|---|
List[Type[BasePluginFlavor]]
|
A list of new plugin flavors. |
Source code in src/zenml/integrations/integration.py
188 189 190 191 192 193 194 195 |
|
Modules
annotators
Initialization of the Argilla annotators submodule.
Classes
ArgillaAnnotator(name: str, id: UUID, config: StackComponentConfig, flavor: str, type: StackComponentType, user: Optional[UUID], created: datetime, updated: datetime, labels: Optional[Dict[str, Any]] = None, connector_requirements: Optional[ServiceConnectorRequirements] = None, connector: Optional[UUID] = None, connector_resource_id: Optional[str] = None, *args: Any, **kwargs: Any)
Bases: BaseAnnotator
, AuthenticationMixin
Class to interact with the Argilla annotation interface.
Source code in src/zenml/stack/stack_component.py
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 |
|
config: ArgillaAnnotatorConfig
property
Returns the ArgillaAnnotatorConfig
config.
Returns:
Type | Description |
---|---|
ArgillaAnnotatorConfig
|
The configuration. |
settings_class: Type[ArgillaAnnotatorSettings]
property
Settings class for the Argilla annotator.
Returns:
Type | Description |
---|---|
Type[ArgillaAnnotatorSettings]
|
The settings class. |
add_dataset(**kwargs: Any) -> Any
Create a dataset for annotation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
Any
|
Additional keyword arguments to pass to the Argilla client. -dataset_name: The name of the dataset. -settings: The settings for the dataset. -workspace: The name of the workspace. By default, the first available. |
{}
|
Returns:
Type | Description |
---|---|
Any
|
An Argilla dataset object. |
Raises:
Type | Description |
---|---|
ValueError
|
if |
RuntimeError
|
if the workspace creation fails. |
RuntimeError
|
if the dataset creation fails. |
Source code in src/zenml/integrations/argilla/annotators/argilla_annotator.py
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 |
|
add_records(dataset_name: str, records: Union[Any, List[Dict[str, Any]]], workspace: Optional[str] = None, mapping: Optional[Dict[str, str]] = None) -> Any
Add records to an Argilla dataset for annotation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataset_name
|
str
|
The name of the dataset. |
required |
records
|
Union[Any, List[Dict[str, Any]]]
|
The records to add to the dataset. |
required |
workspace
|
Optional[str]
|
The name of the workspace. By default, the first available. |
None
|
mapping
|
Optional[Dict[str, str]]
|
The mapping of the records to the dataset fields. By default, None. |
None
|
Raises:
Type | Description |
---|---|
RuntimeError
|
If the records cannot be loaded to Argilla. |
Source code in src/zenml/integrations/argilla/annotators/argilla_annotator.py
299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 |
|
delete_dataset(**kwargs: Any) -> None
Deletes a dataset from the annotation interface.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
Any
|
Additional keyword arguments to pass to the Argilla client. -dataset_name: The name of the dataset. -workspace: The name of the workspace. By default, the first available |
{}
|
Raises:
Type | Description |
---|---|
ValueError
|
If the dataset name is not provided or if the datasets is not found. |
Source code in src/zenml/integrations/argilla/annotators/argilla_annotator.py
370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 |
|
get_dataset(**kwargs: Any) -> Any
Gets the dataset with the given name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
Any
|
Additional keyword arguments to pass to the Argilla client. -dataset_name: The name of the dataset. -workspace: The name of the workspace. By default, the first available. |
{}
|
Returns:
Type | Description |
---|---|
Any
|
The Argilla Dataset for the given name and workspace, if specified. |
Raises:
Type | Description |
---|---|
ValueError
|
If the dataset name is not provided or if the dataset does not exist. |
Source code in src/zenml/integrations/argilla/annotators/argilla_annotator.py
337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 |
|
get_dataset_names(**kwargs: Any) -> List[str]
Gets the names of the datasets.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
Any
|
Additional keyword arguments to pass to the Argilla client. -workspace: The name of the workspace. By default, the first available. If set, only the dataset names in the workspace will be returned. |
{}
|
Returns:
Type | Description |
---|---|
List[str]
|
A list of dataset names. |
Source code in src/zenml/integrations/argilla/annotators/argilla_annotator.py
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
|
get_dataset_stats(dataset_name: str, **kwargs: Any) -> Tuple[int, int]
Gets the statistics of the given dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataset_name
|
str
|
The name of the dataset. |
required |
**kwargs
|
Any
|
Additional keyword arguments to pass to the Argilla client. -workspace: The name of the workspace. By default, the first available. |
{}
|
Returns:
Type | Description |
---|---|
Tuple[int, int]
|
A tuple containing (labeled_task_count, unlabeled_task_count) for the dataset. |
Source code in src/zenml/integrations/argilla/annotators/argilla_annotator.py
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 |
|
get_datasets(**kwargs: Any) -> List[Any]
Gets the datasets currently available for annotation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
Any
|
Additional keyword arguments to pass to the Argilla client. -workspace: The name of the workspace. By default, the first available. If set, only the datasets in the workspace will be returned. |
{}
|
Returns:
Type | Description |
---|---|
List[Any]
|
A list of datasets. |
Source code in src/zenml/integrations/argilla/annotators/argilla_annotator.py
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
|
get_labeled_data(**kwargs: Any) -> Any
Gets the dataset containing the labeled data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
Any
|
Additional keyword arguments to pass to the Argilla client. -dataset_name: The name of the dataset. -workspace: The name of the workspace. By default, the first available. |
{}
|
Returns:
Type | Description |
---|---|
Any
|
The list of annotated records. |
Raises:
Type | Description |
---|---|
ValueError
|
If the dataset name is not provided. |
Source code in src/zenml/integrations/argilla/annotators/argilla_annotator.py
399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 |
|
get_unlabeled_data(**kwargs: str) -> Any
Gets the dataset containing the unlabeled data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
str
|
Additional keyword arguments to pass to the Argilla client. |
{}
|
Returns:
Type | Description |
---|---|
Any
|
The list of pending records for annotation. |
Raises:
Type | Description |
---|---|
ValueError
|
If the dataset name is not provided. |
Source code in src/zenml/integrations/argilla/annotators/argilla_annotator.py
423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 |
|
get_url() -> str
Gets the top-level URL of the annotation interface.
Returns:
Type | Description |
---|---|
str
|
The URL of the annotation interface. |
Source code in src/zenml/integrations/argilla/annotators/argilla_annotator.py
58 59 60 61 62 63 64 65 66 67 68 |
|
get_url_for_dataset(dataset_name: str, **kwargs: Any) -> str
Gets the URL of the annotation interface for the given dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataset_name
|
str
|
The name of the dataset. |
required |
**kwargs
|
Any
|
Additional keyword arguments to pass to the Argilla client. -workspace: The name of the workspace. By default, the first available. |
{}
|
Returns:
Type | Description |
---|---|
str
|
The URL of of the dataset annotation interface. |
Source code in src/zenml/integrations/argilla/annotators/argilla_annotator.py
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
|
launch(**kwargs: Any) -> None
Launches the annotation interface.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
Any
|
Additional keyword arguments to pass to the Argilla client. |
{}
|
Source code in src/zenml/integrations/argilla/annotators/argilla_annotator.py
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 |
|
Modules
argilla_annotator
Implementation of the Argilla annotation integration.
ArgillaAnnotator(name: str, id: UUID, config: StackComponentConfig, flavor: str, type: StackComponentType, user: Optional[UUID], created: datetime, updated: datetime, labels: Optional[Dict[str, Any]] = None, connector_requirements: Optional[ServiceConnectorRequirements] = None, connector: Optional[UUID] = None, connector_resource_id: Optional[str] = None, *args: Any, **kwargs: Any)
Bases: BaseAnnotator
, AuthenticationMixin
Class to interact with the Argilla annotation interface.
Source code in src/zenml/stack/stack_component.py
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 |
|
config: ArgillaAnnotatorConfig
property
Returns the ArgillaAnnotatorConfig
config.
Returns:
Type | Description |
---|---|
ArgillaAnnotatorConfig
|
The configuration. |
settings_class: Type[ArgillaAnnotatorSettings]
property
Settings class for the Argilla annotator.
Returns:
Type | Description |
---|---|
Type[ArgillaAnnotatorSettings]
|
The settings class. |
add_dataset(**kwargs: Any) -> Any
Create a dataset for annotation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
Any
|
Additional keyword arguments to pass to the Argilla client. -dataset_name: The name of the dataset. -settings: The settings for the dataset. -workspace: The name of the workspace. By default, the first available. |
{}
|
Returns:
Type | Description |
---|---|
Any
|
An Argilla dataset object. |
Raises:
Type | Description |
---|---|
ValueError
|
if |
RuntimeError
|
if the workspace creation fails. |
RuntimeError
|
if the dataset creation fails. |
Source code in src/zenml/integrations/argilla/annotators/argilla_annotator.py
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 |
|
add_records(dataset_name: str, records: Union[Any, List[Dict[str, Any]]], workspace: Optional[str] = None, mapping: Optional[Dict[str, str]] = None) -> Any
Add records to an Argilla dataset for annotation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataset_name
|
str
|
The name of the dataset. |
required |
records
|
Union[Any, List[Dict[str, Any]]]
|
The records to add to the dataset. |
required |
workspace
|
Optional[str]
|
The name of the workspace. By default, the first available. |
None
|
mapping
|
Optional[Dict[str, str]]
|
The mapping of the records to the dataset fields. By default, None. |
None
|
Raises:
Type | Description |
---|---|
RuntimeError
|
If the records cannot be loaded to Argilla. |
Source code in src/zenml/integrations/argilla/annotators/argilla_annotator.py
299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 |
|
delete_dataset(**kwargs: Any) -> None
Deletes a dataset from the annotation interface.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
Any
|
Additional keyword arguments to pass to the Argilla client. -dataset_name: The name of the dataset. -workspace: The name of the workspace. By default, the first available |
{}
|
Raises:
Type | Description |
---|---|
ValueError
|
If the dataset name is not provided or if the datasets is not found. |
Source code in src/zenml/integrations/argilla/annotators/argilla_annotator.py
370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 |
|
get_dataset(**kwargs: Any) -> Any
Gets the dataset with the given name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
Any
|
Additional keyword arguments to pass to the Argilla client. -dataset_name: The name of the dataset. -workspace: The name of the workspace. By default, the first available. |
{}
|
Returns:
Type | Description |
---|---|
Any
|
The Argilla Dataset for the given name and workspace, if specified. |
Raises:
Type | Description |
---|---|
ValueError
|
If the dataset name is not provided or if the dataset does not exist. |
Source code in src/zenml/integrations/argilla/annotators/argilla_annotator.py
337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 |
|
get_dataset_names(**kwargs: Any) -> List[str]
Gets the names of the datasets.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
Any
|
Additional keyword arguments to pass to the Argilla client. -workspace: The name of the workspace. By default, the first available. If set, only the dataset names in the workspace will be returned. |
{}
|
Returns:
Type | Description |
---|---|
List[str]
|
A list of dataset names. |
Source code in src/zenml/integrations/argilla/annotators/argilla_annotator.py
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
|
get_dataset_stats(dataset_name: str, **kwargs: Any) -> Tuple[int, int]
Gets the statistics of the given dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataset_name
|
str
|
The name of the dataset. |
required |
**kwargs
|
Any
|
Additional keyword arguments to pass to the Argilla client. -workspace: The name of the workspace. By default, the first available. |
{}
|
Returns:
Type | Description |
---|---|
Tuple[int, int]
|
A tuple containing (labeled_task_count, unlabeled_task_count) for the dataset. |
Source code in src/zenml/integrations/argilla/annotators/argilla_annotator.py
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 |
|
get_datasets(**kwargs: Any) -> List[Any]
Gets the datasets currently available for annotation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
Any
|
Additional keyword arguments to pass to the Argilla client. -workspace: The name of the workspace. By default, the first available. If set, only the datasets in the workspace will be returned. |
{}
|
Returns:
Type | Description |
---|---|
List[Any]
|
A list of datasets. |
Source code in src/zenml/integrations/argilla/annotators/argilla_annotator.py
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
|
get_labeled_data(**kwargs: Any) -> Any
Gets the dataset containing the labeled data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
Any
|
Additional keyword arguments to pass to the Argilla client. -dataset_name: The name of the dataset. -workspace: The name of the workspace. By default, the first available. |
{}
|
Returns:
Type | Description |
---|---|
Any
|
The list of annotated records. |
Raises:
Type | Description |
---|---|
ValueError
|
If the dataset name is not provided. |
Source code in src/zenml/integrations/argilla/annotators/argilla_annotator.py
399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 |
|
get_unlabeled_data(**kwargs: str) -> Any
Gets the dataset containing the unlabeled data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
str
|
Additional keyword arguments to pass to the Argilla client. |
{}
|
Returns:
Type | Description |
---|---|
Any
|
The list of pending records for annotation. |
Raises:
Type | Description |
---|---|
ValueError
|
If the dataset name is not provided. |
Source code in src/zenml/integrations/argilla/annotators/argilla_annotator.py
423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 |
|
get_url() -> str
Gets the top-level URL of the annotation interface.
Returns:
Type | Description |
---|---|
str
|
The URL of the annotation interface. |
Source code in src/zenml/integrations/argilla/annotators/argilla_annotator.py
58 59 60 61 62 63 64 65 66 67 68 |
|
get_url_for_dataset(dataset_name: str, **kwargs: Any) -> str
Gets the URL of the annotation interface for the given dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataset_name
|
str
|
The name of the dataset. |
required |
**kwargs
|
Any
|
Additional keyword arguments to pass to the Argilla client. -workspace: The name of the workspace. By default, the first available. |
{}
|
Returns:
Type | Description |
---|---|
str
|
The URL of of the dataset annotation interface. |
Source code in src/zenml/integrations/argilla/annotators/argilla_annotator.py
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
|
launch(**kwargs: Any) -> None
Launches the annotation interface.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
Any
|
Additional keyword arguments to pass to the Argilla client. |
{}
|
Source code in src/zenml/integrations/argilla/annotators/argilla_annotator.py
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 |
|
flavors
Argilla integration flavors.
Classes
ArgillaAnnotatorConfig(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: BaseAnnotatorConfig
, ArgillaAnnotatorSettings
, AuthenticationConfigMixin
Config for the Argilla annotator.
This class combines settings and authentication configurations for Argilla into a single, usable configuration object without adding additional functionality.
Source code in src/zenml/config/secret_reference_mixin.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|
ArgillaAnnotatorFlavor
Bases: BaseAnnotatorFlavor
Argilla annotator flavor.
config_class: Type[ArgillaAnnotatorConfig]
property
Returns ArgillaAnnotatorConfig
config class.
Returns:
Type | Description |
---|---|
Type[ArgillaAnnotatorConfig]
|
The config class. |
docs_url: Optional[str]
property
A url to point at docs explaining this flavor.
Returns:
Type | Description |
---|---|
Optional[str]
|
A flavor docs url. |
implementation_class: Type[ArgillaAnnotator]
property
Implementation class for this flavor.
Returns:
Type | Description |
---|---|
Type[ArgillaAnnotator]
|
The implementation class. |
logo_url: str
property
A url to represent the flavor in the dashboard.
Returns:
Type | Description |
---|---|
str
|
The flavor logo. |
name: str
property
Name of the flavor.
Returns:
Type | Description |
---|---|
str
|
The name of the flavor. |
sdk_docs_url: Optional[str]
property
A url to point at SDK docs explaining this flavor.
Returns:
Type | Description |
---|---|
Optional[str]
|
A flavor SDK docs url. |
ArgillaAnnotatorSettings(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: BaseSettings
Argilla annotator settings.
If you are using a private Hugging Face Spaces instance of Argilla you must pass in https_extra_kwargs.
Attributes:
Name | Type | Description |
---|---|---|
instance_url |
str
|
URL of the Argilla instance. |
api_key |
Optional[str]
|
The api_key for Argilla |
port |
Optional[int]
|
The port to use for the annotation interface. |
headers |
Optional[str]
|
Extra headers to include in the request. |
httpx_extra_kwargs |
Optional[str]
|
Extra kwargs to pass to the client. |
Source code in src/zenml/config/secret_reference_mixin.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|
ensure_instance_url_ends_without_slash(instance_url: str) -> str
classmethod
Pydantic validator to ensure instance URL ends without a slash.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
instance_url
|
str
|
The instance URL to validate. |
required |
Returns:
Type | Description |
---|---|
str
|
The validated instance URL. |
Source code in src/zenml/integrations/argilla/flavors/argilla_annotator_flavor.py
64 65 66 67 68 69 70 71 72 73 74 75 |
|
Modules
argilla_annotator_flavor
Argilla annotator flavor.
ArgillaAnnotatorConfig(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: BaseAnnotatorConfig
, ArgillaAnnotatorSettings
, AuthenticationConfigMixin
Config for the Argilla annotator.
This class combines settings and authentication configurations for Argilla into a single, usable configuration object without adding additional functionality.
Source code in src/zenml/config/secret_reference_mixin.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|
ArgillaAnnotatorFlavor
Bases: BaseAnnotatorFlavor
Argilla annotator flavor.
config_class: Type[ArgillaAnnotatorConfig]
property
Returns ArgillaAnnotatorConfig
config class.
Returns:
Type | Description |
---|---|
Type[ArgillaAnnotatorConfig]
|
The config class. |
docs_url: Optional[str]
property
A url to point at docs explaining this flavor.
Returns:
Type | Description |
---|---|
Optional[str]
|
A flavor docs url. |
implementation_class: Type[ArgillaAnnotator]
property
Implementation class for this flavor.
Returns:
Type | Description |
---|---|
Type[ArgillaAnnotator]
|
The implementation class. |
logo_url: str
property
A url to represent the flavor in the dashboard.
Returns:
Type | Description |
---|---|
str
|
The flavor logo. |
name: str
property
Name of the flavor.
Returns:
Type | Description |
---|---|
str
|
The name of the flavor. |
sdk_docs_url: Optional[str]
property
A url to point at SDK docs explaining this flavor.
Returns:
Type | Description |
---|---|
Optional[str]
|
A flavor SDK docs url. |
ArgillaAnnotatorSettings(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: BaseSettings
Argilla annotator settings.
If you are using a private Hugging Face Spaces instance of Argilla you must pass in https_extra_kwargs.
Attributes:
Name | Type | Description |
---|---|---|
instance_url |
str
|
URL of the Argilla instance. |
api_key |
Optional[str]
|
The api_key for Argilla |
port |
Optional[int]
|
The port to use for the annotation interface. |
headers |
Optional[str]
|
Extra headers to include in the request. |
httpx_extra_kwargs |
Optional[str]
|
Extra kwargs to pass to the client. |
Source code in src/zenml/config/secret_reference_mixin.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|
ensure_instance_url_ends_without_slash(instance_url: str) -> str
classmethod
Pydantic validator to ensure instance URL ends without a slash.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
instance_url
|
str
|
The instance URL to validate. |
required |
Returns:
Type | Description |
---|---|
str
|
The validated instance URL. |
Source code in src/zenml/integrations/argilla/flavors/argilla_annotator_flavor.py
64 65 66 67 68 69 70 71 72 73 74 75 |
|