rapidata 1.5.0__py3-none-any.whl → 1.6.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of rapidata might be problematic. Click here for more details.
- rapidata/__init__.py +2 -1
- rapidata/rapidata_client/__init__.py +1 -1
- rapidata/rapidata_client/order/rapidata_order.py +20 -28
- rapidata/rapidata_client/order/rapidata_order_builder.py +27 -9
- rapidata/rapidata_client/rapidata_client.py +0 -10
- rapidata/rapidata_client/{feature_flags → settings}/__init__.py +1 -0
- rapidata/rapidata_client/{feature_flags → settings}/feature_flags.py +3 -1
- rapidata/rapidata_client/settings/settings.py +123 -0
- rapidata/rapidata_client/workflow/base_workflow.py +3 -3
- {rapidata-1.5.0.dist-info → rapidata-1.6.0.dist-info}/METADATA +1 -1
- {rapidata-1.5.0.dist-info → rapidata-1.6.0.dist-info}/RECORD +13 -16
- rapidata/rapidata_client/utils/__init__.py +0 -0
- rapidata/rapidata_client/utils/utils.py +0 -22
- rapidata/utils/__init__.py +0 -0
- rapidata/utils/image_utils.py +0 -13
- {rapidata-1.5.0.dist-info → rapidata-1.6.0.dist-info}/LICENSE +0 -0
- {rapidata-1.5.0.dist-info → rapidata-1.6.0.dist-info}/WHEEL +0 -0
rapidata/__init__.py
CHANGED
|
@@ -19,7 +19,7 @@ from .metadata import (
|
|
|
19
19
|
PromptMetadata,
|
|
20
20
|
TranscriptionMetadata,
|
|
21
21
|
)
|
|
22
|
-
from .
|
|
22
|
+
from .settings import Settings, FeatureFlags # remove FeatureFlags next major version
|
|
23
23
|
from .country_codes import CountryCodes
|
|
24
24
|
from .assets import MediaAsset, TextAsset, MultiAsset
|
|
25
25
|
from .filter import (
|
|
@@ -3,7 +3,7 @@ from rapidata.rapidata_client.dataset.rapidata_dataset import RapidataDataset
|
|
|
3
3
|
from rapidata.service.openapi_service import OpenAPIService
|
|
4
4
|
import json
|
|
5
5
|
from rapidata.api_client.exceptions import ApiException
|
|
6
|
-
from typing import Optional, cast
|
|
6
|
+
from typing import Optional, cast, Any
|
|
7
7
|
from rapidata.api_client.models.workflow_artifact_model import WorkflowArtifactModel
|
|
8
8
|
from tqdm import tqdm
|
|
9
9
|
|
|
@@ -11,12 +11,11 @@ class RapidataOrder:
|
|
|
11
11
|
"""
|
|
12
12
|
Represents a Rapidata order.
|
|
13
13
|
|
|
14
|
-
:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
:type rapidata_service: RapidataService
|
|
14
|
+
Args:
|
|
15
|
+
The ID of the order.
|
|
16
|
+
The optional Dataset associated with the order.
|
|
17
|
+
The OpenAPIService instance used to interact with the Rapidata API.
|
|
18
|
+
The name of the order.
|
|
20
19
|
"""
|
|
21
20
|
|
|
22
21
|
def __init__(
|
|
@@ -36,30 +35,23 @@ class RapidataOrder:
|
|
|
36
35
|
"""
|
|
37
36
|
Submits the order for processing.
|
|
38
37
|
"""
|
|
39
|
-
|
|
40
38
|
self.openapi_service.order_api.order_submit_post(self.order_id)
|
|
41
39
|
|
|
42
|
-
def
|
|
43
|
-
"""
|
|
44
|
-
Approves the order for execution.
|
|
45
|
-
"""
|
|
46
|
-
self.openapi_service.order_api.order_approve_post(self.order_id)
|
|
47
|
-
|
|
48
|
-
def get_status(self):
|
|
40
|
+
def get_status(self) -> str:
|
|
49
41
|
"""
|
|
50
42
|
Gets the status of the order.
|
|
51
|
-
|
|
52
|
-
:
|
|
53
|
-
|
|
43
|
+
|
|
44
|
+
Returns:
|
|
45
|
+
The status of the order.
|
|
54
46
|
"""
|
|
55
|
-
return self.openapi_service.order_api.order_get_by_id_get(self.order_id)
|
|
47
|
+
return self.openapi_service.order_api.order_get_by_id_get(self.order_id).state
|
|
56
48
|
|
|
57
49
|
def display_progress_bar(self, refresh_rate=5):
|
|
58
50
|
"""
|
|
59
51
|
Displays a progress bar for the order processing using tqdm.
|
|
60
52
|
|
|
61
|
-
:
|
|
62
|
-
|
|
53
|
+
Prameter:
|
|
54
|
+
How often to refresh the progress bar, in seconds.
|
|
63
55
|
"""
|
|
64
56
|
total_rapids = self._get_workflow_progress().total
|
|
65
57
|
with tqdm(total=total_rapids, desc="Processing order", unit="rapids") as pbar:
|
|
@@ -107,15 +99,15 @@ class RapidataOrder:
|
|
|
107
99
|
return progress
|
|
108
100
|
|
|
109
101
|
|
|
110
|
-
def get_results(self):
|
|
102
|
+
def get_results(self) -> dict[str, Any]:
|
|
111
103
|
"""
|
|
112
104
|
Gets the results of the order.
|
|
113
105
|
If the order is still processing, this method will block until the order is completed and then return the results.
|
|
114
106
|
|
|
115
|
-
:
|
|
116
|
-
|
|
107
|
+
Returns:
|
|
108
|
+
The results of the order.
|
|
117
109
|
"""
|
|
118
|
-
while self.get_status()
|
|
110
|
+
while self.get_status() == "Processing":
|
|
119
111
|
sleep(5)
|
|
120
112
|
|
|
121
113
|
try:
|
|
@@ -131,10 +123,10 @@ class RapidataOrder:
|
|
|
131
123
|
raise Exception(f"Failed to parse order results: {str(e)}") from e
|
|
132
124
|
|
|
133
125
|
@property
|
|
134
|
-
def dataset(self):
|
|
126
|
+
def dataset(self) -> RapidataDataset | None:
|
|
135
127
|
"""
|
|
136
128
|
The dataset associated with the order.
|
|
137
|
-
:
|
|
138
|
-
|
|
129
|
+
Returns:
|
|
130
|
+
The RapidataDataset instance.
|
|
139
131
|
"""
|
|
140
132
|
return self._dataset
|
|
@@ -14,11 +14,7 @@ from rapidata.api_client.models.create_order_model_user_filters_inner import (
|
|
|
14
14
|
from rapidata.api_client.models.create_order_model_workflow import (
|
|
15
15
|
CreateOrderModelWorkflow,
|
|
16
16
|
)
|
|
17
|
-
from rapidata.
|
|
18
|
-
from rapidata.api_client.models.language_user_filter_model import (
|
|
19
|
-
LanguageUserFilterModel,
|
|
20
|
-
)
|
|
21
|
-
from rapidata.rapidata_client.feature_flags import FeatureFlags
|
|
17
|
+
from rapidata.rapidata_client.settings import FeatureFlags, Settings
|
|
22
18
|
from rapidata.rapidata_client.metadata.base_metadata import Metadata
|
|
23
19
|
from rapidata.rapidata_client.dataset.rapidata_dataset import RapidataDataset
|
|
24
20
|
from rapidata.rapidata_client.referee.naive_referee import NaiveReferee
|
|
@@ -35,6 +31,8 @@ from rapidata.rapidata_client.assets import MediaAsset, TextAsset, MultiAsset
|
|
|
35
31
|
|
|
36
32
|
from typing import Optional, cast, Sequence
|
|
37
33
|
|
|
34
|
+
from deprecated import deprecated
|
|
35
|
+
|
|
38
36
|
|
|
39
37
|
class RapidataOrderBuilder:
|
|
40
38
|
"""Builder object for creating Rapidata orders.
|
|
@@ -66,7 +64,7 @@ class RapidataOrderBuilder:
|
|
|
66
64
|
self._metadata: list[Metadata] | None = None
|
|
67
65
|
self._aggregator: AggregatorType | None = None
|
|
68
66
|
self._validation_set_id: str | None = None
|
|
69
|
-
self.
|
|
67
|
+
self._settings: Settings | FeatureFlags | None = None # remove featureflag next big release
|
|
70
68
|
self._user_filters: list[Filter] = []
|
|
71
69
|
self._selections: list[Selection] = []
|
|
72
70
|
self._rapids_per_bag: int = 2
|
|
@@ -101,8 +99,8 @@ class RapidataOrderBuilder:
|
|
|
101
99
|
referee=CreateOrderModelReferee(self._referee.to_model()),
|
|
102
100
|
validationSetId=self._validation_set_id,
|
|
103
101
|
featureFlags=(
|
|
104
|
-
self.
|
|
105
|
-
if self.
|
|
102
|
+
self._settings.to_list()
|
|
103
|
+
if self._settings is not None
|
|
106
104
|
else None
|
|
107
105
|
),
|
|
108
106
|
selections=[
|
|
@@ -269,6 +267,26 @@ class RapidataOrderBuilder:
|
|
|
269
267
|
self._metadata = metadata # type: ignore
|
|
270
268
|
return self
|
|
271
269
|
|
|
270
|
+
def settings(self, settings: Settings) -> "RapidataOrderBuilder":
|
|
271
|
+
"""
|
|
272
|
+
Set the settings for the order.
|
|
273
|
+
|
|
274
|
+
Args:
|
|
275
|
+
settings (Settings): The settings to be set.
|
|
276
|
+
|
|
277
|
+
Returns:
|
|
278
|
+
RapidataOrderBuilder: The updated RapidataOrderBuilder instance.
|
|
279
|
+
"""
|
|
280
|
+
if not isinstance(settings, Settings):
|
|
281
|
+
raise TypeError("Settings must be of type Settings.")
|
|
282
|
+
|
|
283
|
+
self._settings = settings
|
|
284
|
+
return self
|
|
285
|
+
|
|
286
|
+
@deprecated(
|
|
287
|
+
version="1.6.0",
|
|
288
|
+
reason="The feature_flags method is deprecated, use settings instead.",
|
|
289
|
+
)
|
|
272
290
|
def feature_flags(self, feature_flags: FeatureFlags) -> "RapidataOrderBuilder":
|
|
273
291
|
"""
|
|
274
292
|
Set the feature flags for the order.
|
|
@@ -282,7 +300,7 @@ class RapidataOrderBuilder:
|
|
|
282
300
|
if not isinstance(feature_flags, FeatureFlags):
|
|
283
301
|
raise TypeError("Feature flags must be of type FeatureFlags.")
|
|
284
302
|
|
|
285
|
-
self.
|
|
303
|
+
self._settings = feature_flags
|
|
286
304
|
return self
|
|
287
305
|
|
|
288
306
|
def filters(self, filters: Sequence[Filter]) -> "RapidataOrderBuilder":
|
|
@@ -3,7 +3,6 @@ from rapidata.rapidata_client.dataset.rapidata_validation_set import (
|
|
|
3
3
|
)
|
|
4
4
|
from rapidata.rapidata_client.dataset.validation_set_builder import ValidationSetBuilder
|
|
5
5
|
from rapidata.rapidata_client.order.rapidata_order_builder import RapidataOrderBuilder
|
|
6
|
-
from rapidata.rapidata_client.utils.utils import Utils
|
|
7
6
|
from rapidata.service.openapi_service import OpenAPIService
|
|
8
7
|
from rapidata.rapidata_client.order.rapidata_order import RapidataOrder
|
|
9
8
|
from rapidata.rapidata_client.dataset.rapidata_dataset import RapidataDataset
|
|
@@ -178,12 +177,3 @@ class RapidataClient:
|
|
|
178
177
|
CompareQuestionBuilder: A CompareQuestionBuilder instance.
|
|
179
178
|
"""
|
|
180
179
|
return CompareCriteriaBuilder(name=name, openapi_service=self.openapi_service)
|
|
181
|
-
|
|
182
|
-
@property
|
|
183
|
-
def utils(self) -> Utils:
|
|
184
|
-
"""Get the Utils instance.
|
|
185
|
-
|
|
186
|
-
Returns:
|
|
187
|
-
Utils: The Utils instance associated with this client.
|
|
188
|
-
"""
|
|
189
|
-
return Utils(openapi_service=self.openapi_service)
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
from rapidata.api_client.models.feature_flag_model import FeatureFlagModel
|
|
2
2
|
from enum import Enum
|
|
3
|
+
from deprecated import deprecated
|
|
3
4
|
|
|
4
5
|
class TranslationBehaviour(Enum):
|
|
5
6
|
BOTH = "both"
|
|
6
7
|
ONLY_ORIGINAL = "only original"
|
|
7
8
|
ONLY_TRANSLATED = "only translated"
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
@deprecated(version="1.6.0", reason="Use the Settings class instead.")
|
|
10
11
|
class FeatureFlags:
|
|
11
12
|
"""A class to manage feature flags.
|
|
12
13
|
|
|
@@ -17,6 +18,7 @@ class FeatureFlags:
|
|
|
17
18
|
_flags (dict[str, str]): A dictionary to store feature flags.
|
|
18
19
|
"""
|
|
19
20
|
|
|
21
|
+
@deprecated(version="1.6.0", reason="Use the Settings class instead.")
|
|
20
22
|
def __init__(self):
|
|
21
23
|
"""Initialize the FeatureFlags object with an empty flags dictionary."""
|
|
22
24
|
self._flags: dict[str, str] = {}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
from rapidata.api_client.models.feature_flag_model import FeatureFlagModel
|
|
2
|
+
from enum import Enum
|
|
3
|
+
|
|
4
|
+
class TranslationBehaviour(Enum):
|
|
5
|
+
BOTH = "both"
|
|
6
|
+
ONLY_ORIGINAL = "only original"
|
|
7
|
+
ONLY_TRANSLATED = "only translated"
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Settings:
|
|
11
|
+
"""A class to manage settings.
|
|
12
|
+
|
|
13
|
+
This class provides methods to set and manage various settings
|
|
14
|
+
used in the application.
|
|
15
|
+
|
|
16
|
+
Attributes:
|
|
17
|
+
_settings (dict[str, str]): A dictionary to store settings.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
def __init__(self):
|
|
21
|
+
"""Initialize the Settings object with an empty flags dictionary."""
|
|
22
|
+
self._settings: dict[str, str] = {}
|
|
23
|
+
|
|
24
|
+
def to_list(self) -> list[FeatureFlagModel]:
|
|
25
|
+
"""Convert the settings to a list of FeatureFlagModel objects.
|
|
26
|
+
|
|
27
|
+
Returns:
|
|
28
|
+
list[FeatureFlagModel]: A list of FeatureFlagModel objects
|
|
29
|
+
representing the current settings.
|
|
30
|
+
"""
|
|
31
|
+
return [
|
|
32
|
+
FeatureFlagModel(key=name, value=value)
|
|
33
|
+
for name, value in self._settings.items()
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
def alert_on_fast_response(self, milliseconds: int):
|
|
37
|
+
"""Gives an alert as a pop up on the UI when the response time is less than the threshold.
|
|
38
|
+
|
|
39
|
+
Args:
|
|
40
|
+
milliseconds (int): if the user responds in less than this time, an alert will be shown.
|
|
41
|
+
|
|
42
|
+
Returns:
|
|
43
|
+
Settings: The current Settings instance for method chaining.
|
|
44
|
+
"""
|
|
45
|
+
if milliseconds < 10:
|
|
46
|
+
print(
|
|
47
|
+
f"Warning: Are you sure you want to set the threshold so low ({milliseconds} milliseconds)?"
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
if milliseconds > 30000:
|
|
51
|
+
print(
|
|
52
|
+
f"Warning: Are you sure you want to set the threshold so high ({milliseconds/1000} seconds)?"
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
self._settings["alert_on_fast_response"] = str(milliseconds)
|
|
56
|
+
return self
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def translation_behaviour(self, behaviour: TranslationBehaviour = TranslationBehaviour.BOTH):
|
|
60
|
+
"""Defines what's the behaviour of the translation in the UI.
|
|
61
|
+
|
|
62
|
+
The behaviour can be set to:
|
|
63
|
+
- TranslationBehaviour.BOTH: Show both the original and the translated text.
|
|
64
|
+
- TranslationBehaviour.ONLY_ORIGINAL: Show only the original text.
|
|
65
|
+
- TranslationBehaviour.ONLY_TRANSLATED: Show only the translated text.
|
|
66
|
+
|
|
67
|
+
Args:
|
|
68
|
+
behaviour (TranslationBehaviour): The translation behaviour. Defaults to TranslationBehaviour.BOTH.
|
|
69
|
+
|
|
70
|
+
Returns:
|
|
71
|
+
Settings: The current Settings instance for method chaining.
|
|
72
|
+
"""
|
|
73
|
+
self._settings["translation_behaviour"] = behaviour.value
|
|
74
|
+
return self
|
|
75
|
+
|
|
76
|
+
def free_text_minimum_characters(self, value: int):
|
|
77
|
+
"""Set the minimum number of characters a user has to type before the task can be successfully submitted.
|
|
78
|
+
|
|
79
|
+
Args:
|
|
80
|
+
value (int): The minimum number of characters for free text.
|
|
81
|
+
|
|
82
|
+
Returns:
|
|
83
|
+
Settings: The current Settings instance for method chaining.
|
|
84
|
+
"""
|
|
85
|
+
self._settings["free_text_minimum_characters"] = str(value)
|
|
86
|
+
return self
|
|
87
|
+
|
|
88
|
+
def no_shuffle(self, value: bool = True):
|
|
89
|
+
"""Only for classify tasks. If true, the order of the categories will be the same as the one in the workflow.
|
|
90
|
+
|
|
91
|
+
Args:
|
|
92
|
+
value (bool, optional): Whether to disable shuffling. Defaults to True.
|
|
93
|
+
|
|
94
|
+
Returns:
|
|
95
|
+
Settings: The current Settings instance for method chaining.
|
|
96
|
+
"""
|
|
97
|
+
self._settings["no_shuffle"] = str(value)
|
|
98
|
+
return self
|
|
99
|
+
|
|
100
|
+
def compare_with_prompt_design(self, value: bool = True):
|
|
101
|
+
"""A special design to compare two texts/images based on a criteria and a given prompt.
|
|
102
|
+
|
|
103
|
+
Args:
|
|
104
|
+
value (bool, optional): Whether to enable compare with prompt design. Defaults to True.
|
|
105
|
+
|
|
106
|
+
Returns:
|
|
107
|
+
Settings: The current Settings instance for method chaining.
|
|
108
|
+
"""
|
|
109
|
+
self._settings["claire"] = str(value)
|
|
110
|
+
return self
|
|
111
|
+
|
|
112
|
+
def key_value(self, key: str, value: str):
|
|
113
|
+
"""Set a custom setting with the given key and value. Use this to enable features that do not have a dedicated method (yet).
|
|
114
|
+
|
|
115
|
+
Args:
|
|
116
|
+
key (str): The key for the custom setting.
|
|
117
|
+
value (str): The value for the custom setting.
|
|
118
|
+
|
|
119
|
+
Returns:
|
|
120
|
+
Settings: The current Settings instance for method chaining.
|
|
121
|
+
"""
|
|
122
|
+
self._settings[key] = value
|
|
123
|
+
return self
|
|
@@ -4,7 +4,7 @@ from typing import Any
|
|
|
4
4
|
from rapidata.api_client.models.simple_workflow_model import SimpleWorkflowModel
|
|
5
5
|
from rapidata.api_client.models.evaluation_workflow_model import EvaluationWorkflowModel
|
|
6
6
|
from rapidata.api_client.models.compare_workflow_model import CompareWorkflowModel
|
|
7
|
-
from rapidata.rapidata_client.
|
|
7
|
+
from rapidata.rapidata_client.settings import Settings
|
|
8
8
|
from rapidata.rapidata_client.referee.base_referee import Referee
|
|
9
9
|
|
|
10
10
|
|
|
@@ -13,7 +13,7 @@ class Workflow(ABC):
|
|
|
13
13
|
def __init__(self, type: str):
|
|
14
14
|
self._type = type
|
|
15
15
|
self._target_country_codes: list[str] = []
|
|
16
|
-
self._feature_flags:
|
|
16
|
+
self._feature_flags: Settings = Settings()
|
|
17
17
|
|
|
18
18
|
def to_dict(self) -> dict[str, Any]:
|
|
19
19
|
return {
|
|
@@ -37,6 +37,6 @@ class Workflow(ABC):
|
|
|
37
37
|
self._target_country_codes = target_country_codes
|
|
38
38
|
return self
|
|
39
39
|
|
|
40
|
-
def feature_flags(self, feature_flags:
|
|
40
|
+
def feature_flags(self, feature_flags: Settings):
|
|
41
41
|
self._feature_flags = feature_flags
|
|
42
42
|
return self
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
rapidata/__init__.py,sha256=
|
|
1
|
+
rapidata/__init__.py,sha256=PwuTW_WL75klRHmgTPKVqIVQJg32Uq48TBxxYI6qUvI,621
|
|
2
2
|
rapidata/api_client/__init__.py,sha256=qjZpyMWRZgTrH3dtHsT1niqRKVVU92e_HCsoH2H8ypc,23396
|
|
3
3
|
rapidata/api_client/api/__init__.py,sha256=S0oVoAVMys10M-Z1SqirMdnHMYSHH3Lz6iph1CfILc0,1004
|
|
4
4
|
rapidata/api_client/api/campaign_api.py,sha256=DxPFqt9F6c9OpXu_Uxhsrib2NVwnbcZFa3Vkrj7cIuA,40474
|
|
@@ -314,7 +314,7 @@ rapidata/api_client/models/workflow_split_model_filter_configs_inner.py,sha256=1
|
|
|
314
314
|
rapidata/api_client/models/workflow_state.py,sha256=5LAK1se76RCoozeVB6oxMPb8p_5bhLZJqn7q5fFQWis,850
|
|
315
315
|
rapidata/api_client/rest.py,sha256=zmCIFQC2l1t-KZcq-TgEm3vco3y_LK6vRm3Q07K-xRI,9423
|
|
316
316
|
rapidata/api_client_README.md,sha256=wSrVJxrpMg3zHtVmiiPgmFB8_8PQLQkkk4a0595zcHc,34887
|
|
317
|
-
rapidata/rapidata_client/__init__.py,sha256=
|
|
317
|
+
rapidata/rapidata_client/__init__.py,sha256=mmfjHy_GMA7xFU_haNwxjNRaCF505iPXhE4KC2dXObY,841
|
|
318
318
|
rapidata/rapidata_client/assets/__init__.py,sha256=T-XKvMSkmyI8iYLUYDdZ3LrrSInHsGMUY_Tz77hhnlE,240
|
|
319
319
|
rapidata/rapidata_client/assets/base_asset.py,sha256=B2YWH1NgaeYUYHDW3OPpHM_bqawHbH4EjnRCE2BYwiM,298
|
|
320
320
|
rapidata/rapidata_client/assets/media_asset.py,sha256=4xU1k2abdHGwbkJAYNOZYyOPB__5VBRDvRjklegFufQ,887
|
|
@@ -328,8 +328,6 @@ rapidata/rapidata_client/dataset/rapidata_dataset.py,sha256=12mvcpHa-ZpDOFhSuqnS
|
|
|
328
328
|
rapidata/rapidata_client/dataset/rapidata_validation_set.py,sha256=KhvHMML591h61I9lqXSmp_s2_VZAWmuCoixmA2rAI8c,10973
|
|
329
329
|
rapidata/rapidata_client/dataset/validation_rapid_parts.py,sha256=uzpOZFqQu8bG6vmjcWWUNJPZsRe28OmnyalRE6ry8tk,2317
|
|
330
330
|
rapidata/rapidata_client/dataset/validation_set_builder.py,sha256=ApYyEIwf9CQfnKJ2nZwK9FzgnY3Ff3BWetv75OlR-KM,8018
|
|
331
|
-
rapidata/rapidata_client/feature_flags/__init__.py,sha256=IYkcK_bZCl5RfyQFiWjjUdz4y0jipiW9qfeopq4EjQQ,40
|
|
332
|
-
rapidata/rapidata_client/feature_flags/feature_flags.py,sha256=ESwPY0mHDCzY_rjYastl1rWZVbmt-3gc9lHQdwgGfGo,4479
|
|
333
331
|
rapidata/rapidata_client/filter/__init__.py,sha256=F3JsMCbAZWH7SNdgaj98ydTqgCCKXKBhLyt9gQ4x6tQ,301
|
|
334
332
|
rapidata/rapidata_client/filter/age_filter.py,sha256=hncr1zNM_HrO0fCta8h0LgTCB8Ufv_vI5_cGhMb-xr8,478
|
|
335
333
|
rapidata/rapidata_client/filter/base_filter.py,sha256=nXraj72cumyQjjYoo4MMpnlE0aWjAIOmGakKf0MNqps,135
|
|
@@ -345,9 +343,9 @@ rapidata/rapidata_client/metadata/prompt_metadata.py,sha256=_FypjKWrC3iKUO_G2CVw
|
|
|
345
343
|
rapidata/rapidata_client/metadata/public_text_metadata.py,sha256=LTiBQHs6izxQ6-C84d6Pf7lL4ENTDgg__HZnDKvzvMc,511
|
|
346
344
|
rapidata/rapidata_client/metadata/transcription_metadata.py,sha256=THtDEVCON4UlcXHmXrjilaOLHys4TrktUOPGWnXaCcc,631
|
|
347
345
|
rapidata/rapidata_client/order/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
348
|
-
rapidata/rapidata_client/order/rapidata_order.py,sha256=
|
|
349
|
-
rapidata/rapidata_client/order/rapidata_order_builder.py,sha256=
|
|
350
|
-
rapidata/rapidata_client/rapidata_client.py,sha256=
|
|
346
|
+
rapidata/rapidata_client/order/rapidata_order.py,sha256=t5ddz_6Dk2DOpsDQ2EiZHJJB1RzU-etKwBL0RErEsSY,4567
|
|
347
|
+
rapidata/rapidata_client/order/rapidata_order_builder.py,sha256=b--9byhsiAW1fL0mVSPzGJT0X4MQ-tCC0BNjIm2vu-Q,16406
|
|
348
|
+
rapidata/rapidata_client/rapidata_client.py,sha256=DwWi7gtACV_OxQDEBHCILv8921tWQy3UtXzJ0ZcjjTo,8018
|
|
351
349
|
rapidata/rapidata_client/referee/__init__.py,sha256=E1VODxTjoQRnxzdgMh3aRlDLouxe1nWuvozEHXD2gq4,150
|
|
352
350
|
rapidata/rapidata_client/referee/base_referee.py,sha256=bMy7cw0a-pGNbFu6u_1_Jplu0A483Ubj4oDQzh8vu8k,493
|
|
353
351
|
rapidata/rapidata_client/referee/early_stopping_referee.py,sha256=Dg2Kk7OiLBtS3kknsLxyJIlS27xmPvsikFR6g4xlbTE,1862
|
|
@@ -359,13 +357,14 @@ rapidata/rapidata_client/selection/conditional_validation_selection.py,sha256=wP
|
|
|
359
357
|
rapidata/rapidata_client/selection/demographic_selection.py,sha256=DnMbLhzRItZ0t4Engo2fav4imG01JqAmn0SHOoPOhnQ,516
|
|
360
358
|
rapidata/rapidata_client/selection/labeling_selection.py,sha256=cqDMQEXfQGMmgIvPgGOYgIGaXflV_J7LZsGOsakLXqo,425
|
|
361
359
|
rapidata/rapidata_client/selection/validation_selection.py,sha256=HswzD2SvZZWisNLoGj--0sT_TIK8crYp3xGGndo6aLY,523
|
|
360
|
+
rapidata/rapidata_client/settings/__init__.py,sha256=pqAmWPURaZ71rz6ogUH2rnfKL3rf7k4IhLyeM8ZHVlI,71
|
|
361
|
+
rapidata/rapidata_client/settings/feature_flags.py,sha256=aKnxl1kv4cC3TaHV-xfqYlvL3ATIB2-H0VKl1rUt8jQ,4658
|
|
362
|
+
rapidata/rapidata_client/settings/settings.py,sha256=oglRs-xgMGW8t2DhHfWIjWGkPW9Bm_fIaTTcaQKy-b8,4410
|
|
362
363
|
rapidata/rapidata_client/simple_builders/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
363
364
|
rapidata/rapidata_client/simple_builders/simple_classification_builders.py,sha256=gTb1OzJZjNW48ltrp0v9tcDjLee9_ZiLw78zYziVu_g,5520
|
|
364
365
|
rapidata/rapidata_client/simple_builders/simple_compare_builders.py,sha256=GmNIUoAkoAHp0OnWLOgeI5-wnDiycuye0o1CUa9c3Q0,4808
|
|
365
|
-
rapidata/rapidata_client/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
366
|
-
rapidata/rapidata_client/utils/utils.py,sha256=Fl99gCnh_HnieIp099xEvEv4g2kEIKiFcUp0G2iz6x8,815
|
|
367
366
|
rapidata/rapidata_client/workflow/__init__.py,sha256=xWuzAhBnbcUFfWcgYrzj8ZYLSOXyFtgfepgMrf0hNhU,290
|
|
368
|
-
rapidata/rapidata_client/workflow/base_workflow.py,sha256=
|
|
367
|
+
rapidata/rapidata_client/workflow/base_workflow.py,sha256=iDBeklFwOIbMuJHA7t-x_cwxfygJCG0SoXLBB7R53fQ,1395
|
|
369
368
|
rapidata/rapidata_client/workflow/classify_workflow.py,sha256=NkyyBrlCDqYVQaCARR9EHYuREEtXond69kD6jbzcN3M,1713
|
|
370
369
|
rapidata/rapidata_client/workflow/compare_workflow.py,sha256=nqrgtohlXBfgHh_cRPOFAlwdI8wVc7PUsH0FDM7wIjg,1431
|
|
371
370
|
rapidata/rapidata_client/workflow/evaluation_workflow.py,sha256=IBQoVFxOaeCDIBfaaboytWk8hNX9QH_xikkXt3lu9GY,619
|
|
@@ -374,9 +373,7 @@ rapidata/rapidata_client/workflow/transcription_workflow.py,sha256=_KDtGCdRhauJm
|
|
|
374
373
|
rapidata/service/__init__.py,sha256=s9bS1AJZaWIhLtJX_ZA40_CK39rAAkwdAmymTMbeWl4,68
|
|
375
374
|
rapidata/service/local_file_service.py,sha256=pgorvlWcx52Uh3cEG6VrdMK_t__7dacQ_5AnfY14BW8,877
|
|
376
375
|
rapidata/service/openapi_service.py,sha256=l-ga9TLKWR6Gwx9nbDSQ2J1HZRPhgk_mGgnC3kud3uw,3688
|
|
377
|
-
rapidata/
|
|
378
|
-
rapidata/
|
|
379
|
-
rapidata-1.
|
|
380
|
-
rapidata-1.
|
|
381
|
-
rapidata-1.5.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
382
|
-
rapidata-1.5.0.dist-info/RECORD,,
|
|
376
|
+
rapidata-1.6.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
377
|
+
rapidata-1.6.0.dist-info/METADATA,sha256=lQFu7Zzja9wuFSOzxsCrZ0dezR2YodP6snRFkjXscEo,1012
|
|
378
|
+
rapidata-1.6.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
379
|
+
rapidata-1.6.0.dist-info/RECORD,,
|
|
File without changes
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
from rapidata.api_client.models.classify_payload import ClassifyPayload
|
|
2
|
-
from rapidata.api_client.models.create_demographic_rapid_model import (
|
|
3
|
-
CreateDemographicRapidModel,
|
|
4
|
-
)
|
|
5
|
-
from rapidata.service.openapi_service import OpenAPIService
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class Utils:
|
|
9
|
-
def __init__(self, openapi_service: OpenAPIService):
|
|
10
|
-
self.openapi_service = openapi_service
|
|
11
|
-
|
|
12
|
-
def new_demographic_rapid(
|
|
13
|
-
self, question: str, options: list[str], identifier: str, media_path: str
|
|
14
|
-
):
|
|
15
|
-
payload = ClassifyPayload(
|
|
16
|
-
_t="ClassifyPayload", title=question, possibleCategories=options
|
|
17
|
-
)
|
|
18
|
-
model = CreateDemographicRapidModel(identifier=identifier, payload=payload)
|
|
19
|
-
|
|
20
|
-
self.openapi_service.rapid_api.rapid_create_demographic_rapid_post(
|
|
21
|
-
model=model, file=[media_path]
|
|
22
|
-
)
|
rapidata/utils/__init__.py
DELETED
|
File without changes
|
rapidata/utils/image_utils.py
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
from io import BytesIO
|
|
2
|
-
import PIL.Image as Image
|
|
3
|
-
|
|
4
|
-
class ImageUtils:
|
|
5
|
-
|
|
6
|
-
@staticmethod
|
|
7
|
-
def convert_PIL_image_to_bytes(image: Image.Image):
|
|
8
|
-
"""
|
|
9
|
-
Convert a PIL image to bytes with meta data encoded. We can't just use image.tobytes() because this only returns the pixel data.
|
|
10
|
-
"""
|
|
11
|
-
buffer = BytesIO()
|
|
12
|
-
image.save(buffer, image.format)
|
|
13
|
-
return buffer.getvalue()
|
|
File without changes
|
|
File without changes
|