featrixsphere 0.2.1439__py3-none-any.whl → 0.2.1462__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.
- featrixsphere/__init__.py +1 -1
- featrixsphere/client.py +44 -6
- {featrixsphere-0.2.1439.dist-info → featrixsphere-0.2.1462.dist-info}/METADATA +1 -1
- featrixsphere-0.2.1462.dist-info/RECORD +9 -0
- featrixsphere-0.2.1439.dist-info/RECORD +0 -9
- {featrixsphere-0.2.1439.dist-info → featrixsphere-0.2.1462.dist-info}/WHEEL +0 -0
- {featrixsphere-0.2.1439.dist-info → featrixsphere-0.2.1462.dist-info}/entry_points.txt +0 -0
- {featrixsphere-0.2.1439.dist-info → featrixsphere-0.2.1462.dist-info}/top_level.txt +0 -0
featrixsphere/__init__.py
CHANGED
featrixsphere/client.py
CHANGED
|
@@ -1635,7 +1635,7 @@ class FeatrixSphereClient:
|
|
|
1635
1635
|
ax.text(0.5, 0.5, f'Error plotting embedding: {e}',
|
|
1636
1636
|
transform=ax.transAxes, ha='center', va='center')
|
|
1637
1637
|
|
|
1638
|
-
def create_embedding_space(self, name: str, s3_training_dataset: str, s3_validation_dataset: str, webhooks: Dict[str, str] = None) -> SessionInfo:
|
|
1638
|
+
def create_embedding_space(self, name: str, s3_training_dataset: str, s3_validation_dataset: str, webhooks: Dict[str, str] = None, user_metadata: Dict[str, Any] = None) -> SessionInfo:
|
|
1639
1639
|
"""
|
|
1640
1640
|
Create a new embedding space from S3 training and validation datasets.
|
|
1641
1641
|
|
|
@@ -1644,6 +1644,7 @@ class FeatrixSphereClient:
|
|
|
1644
1644
|
s3_training_dataset: S3 URL for training dataset (must start with 's3://')
|
|
1645
1645
|
s3_validation_dataset: S3 URL for validation dataset (must start with 's3://')
|
|
1646
1646
|
webhooks: Optional dict with webhook configuration keys (webhook_callback_secret, s3_backup_url, model_id_update_url)
|
|
1647
|
+
user_metadata: Optional user metadata for ES/SP identification (max 32KB)
|
|
1647
1648
|
|
|
1648
1649
|
Returns:
|
|
1649
1650
|
SessionInfo for the newly created embedding space session
|
|
@@ -1668,6 +1669,10 @@ class FeatrixSphereClient:
|
|
|
1668
1669
|
}
|
|
1669
1670
|
if webhooks:
|
|
1670
1671
|
data['webhooks'] = webhooks
|
|
1672
|
+
if user_metadata:
|
|
1673
|
+
import json
|
|
1674
|
+
data['user_metadata'] = json.dumps(user_metadata)
|
|
1675
|
+
print(f"User metadata: {user_metadata}")
|
|
1671
1676
|
|
|
1672
1677
|
response_data = self._post_json("/compute/create-embedding-space", data)
|
|
1673
1678
|
|
|
@@ -1689,7 +1694,8 @@ class FeatrixSphereClient:
|
|
|
1689
1694
|
parent_embedding_space_path: str = None,
|
|
1690
1695
|
s3_training_dataset: str = None,
|
|
1691
1696
|
s3_validation_dataset: str = None,
|
|
1692
|
-
webhooks: Dict[str, str] = None
|
|
1697
|
+
webhooks: Dict[str, str] = None,
|
|
1698
|
+
user_metadata: Dict[str, Any] = None
|
|
1693
1699
|
) -> SessionInfo:
|
|
1694
1700
|
"""
|
|
1695
1701
|
Fine-tune an existing embedding space on new data.
|
|
@@ -1785,6 +1791,10 @@ class FeatrixSphereClient:
|
|
|
1785
1791
|
|
|
1786
1792
|
if webhooks:
|
|
1787
1793
|
data['webhooks'] = webhooks
|
|
1794
|
+
if user_metadata:
|
|
1795
|
+
import json
|
|
1796
|
+
data['user_metadata'] = json.dumps(user_metadata)
|
|
1797
|
+
print(f"User metadata: {user_metadata}")
|
|
1788
1798
|
|
|
1789
1799
|
response_data = self._post_json("/compute/fine-tune-embedding-space", data)
|
|
1790
1800
|
|
|
@@ -4203,7 +4213,8 @@ class FeatrixSphereClient:
|
|
|
4203
4213
|
class_imbalance: dict = None,
|
|
4204
4214
|
poll_interval: int = 30, max_poll_time: int = 3600,
|
|
4205
4215
|
verbose: bool = True,
|
|
4206
|
-
webhooks: Dict[str, str] = None
|
|
4216
|
+
webhooks: Dict[str, str] = None,
|
|
4217
|
+
user_metadata: Dict[str, Any] = None) -> SessionInfo:
|
|
4207
4218
|
"""
|
|
4208
4219
|
Train a single predictor on a foundation model (existing embedding space).
|
|
4209
4220
|
|
|
@@ -4227,6 +4238,7 @@ class FeatrixSphereClient:
|
|
|
4227
4238
|
max_poll_time: Maximum time to poll in seconds (default: 3600 = 1 hour)
|
|
4228
4239
|
verbose: Whether to print status updates during polling (default: True)
|
|
4229
4240
|
webhooks: Optional dict with webhook configuration keys (webhook_callback_secret, s3_backup_url, model_id_update_url)
|
|
4241
|
+
user_metadata: Optional user metadata for ES/SP identification (max 32KB)
|
|
4230
4242
|
|
|
4231
4243
|
Returns:
|
|
4232
4244
|
SessionInfo for the newly created predictor training session
|
|
@@ -4236,9 +4248,28 @@ class FeatrixSphereClient:
|
|
|
4236
4248
|
|
|
4237
4249
|
# Get the compute cluster from the foundation model session
|
|
4238
4250
|
# This ensures we upload files to the same node where the foundation model lives
|
|
4239
|
-
|
|
4240
|
-
foundation_compute_cluster =
|
|
4241
|
-
|
|
4251
|
+
# If the foundation session doesn't exist (404), we'll proceed with current compute cluster
|
|
4252
|
+
foundation_compute_cluster = None
|
|
4253
|
+
try:
|
|
4254
|
+
foundation_session = self.get_session_status(foundation_model_id)
|
|
4255
|
+
foundation_compute_cluster = self.get_last_server_metadata()
|
|
4256
|
+
foundation_compute_cluster = foundation_compute_cluster.get('compute_cluster') if foundation_compute_cluster else None
|
|
4257
|
+
except Exception as e:
|
|
4258
|
+
# Foundation session might not exist or be accessible - that's okay
|
|
4259
|
+
# The server will validate it when we submit the training request
|
|
4260
|
+
if verbose:
|
|
4261
|
+
# Check if it's a 404 HTTP error
|
|
4262
|
+
is_404 = False
|
|
4263
|
+
if isinstance(e, requests.exceptions.HTTPError):
|
|
4264
|
+
if hasattr(e, 'response') and e.response.status_code == 404:
|
|
4265
|
+
is_404 = True
|
|
4266
|
+
|
|
4267
|
+
if is_404:
|
|
4268
|
+
print(f" ⚠️ Foundation session not found (404) - will use current compute cluster")
|
|
4269
|
+
print(f" Server will validate foundation model when training starts")
|
|
4270
|
+
else:
|
|
4271
|
+
print(f" ⚠️ Could not fetch foundation session: {e}")
|
|
4272
|
+
print(f" Will proceed with current compute cluster")
|
|
4242
4273
|
|
|
4243
4274
|
# Temporarily set compute cluster for file uploads if we found one
|
|
4244
4275
|
original_compute_cluster = self.compute_cluster
|
|
@@ -4247,6 +4278,8 @@ class FeatrixSphereClient:
|
|
|
4247
4278
|
self.set_compute_cluster(foundation_compute_cluster)
|
|
4248
4279
|
if verbose:
|
|
4249
4280
|
print(f" Using compute cluster: {foundation_compute_cluster}")
|
|
4281
|
+
elif verbose and self.compute_cluster:
|
|
4282
|
+
print(f" Using current compute cluster: {self.compute_cluster}")
|
|
4250
4283
|
|
|
4251
4284
|
try:
|
|
4252
4285
|
# Validate that only one data source is provided
|
|
@@ -4318,6 +4351,11 @@ class FeatrixSphereClient:
|
|
|
4318
4351
|
if webhooks:
|
|
4319
4352
|
import json
|
|
4320
4353
|
data["webhooks"] = json.dumps(webhooks)
|
|
4354
|
+
if user_metadata:
|
|
4355
|
+
import json
|
|
4356
|
+
data["user_metadata"] = json.dumps(user_metadata)
|
|
4357
|
+
if verbose:
|
|
4358
|
+
print(f"User metadata: {user_metadata}")
|
|
4321
4359
|
|
|
4322
4360
|
# Send request with file if provided
|
|
4323
4361
|
try:
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
featrixsphere/__init__.py,sha256=oJsLRgA3q8pSL3rPso0kfVmgPoKdivl2gt4Gj3OZW_M,1888
|
|
2
|
+
featrixsphere/cli.py,sha256=AW9O3vCvCNJ2UxVGN66eRmeN7XLSiHJlvK6JLZ9UJXc,13358
|
|
3
|
+
featrixsphere/client.py,sha256=HWbVkvvZ3MZae_hfa0ChurzrSHMnxTWDW59tOcLERag,386715
|
|
4
|
+
featrixsphere/test_client.py,sha256=4SiRbib0ms3poK0UpnUv4G0HFQSzidF3Iswo_J2cjLk,11981
|
|
5
|
+
featrixsphere-0.2.1462.dist-info/METADATA,sha256=odh92kvhANd28hRmWToVCsW8hv-jb2YLpBdFegOHNkM,16232
|
|
6
|
+
featrixsphere-0.2.1462.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
7
|
+
featrixsphere-0.2.1462.dist-info/entry_points.txt,sha256=QreJeYfD_VWvbEqPmMXZ3pqqlFlJ1qZb-NtqnyhEldc,51
|
|
8
|
+
featrixsphere-0.2.1462.dist-info/top_level.txt,sha256=AyN4wjfzlD0hWnDieuEHX0KckphIk_aC73XCG4df5uU,14
|
|
9
|
+
featrixsphere-0.2.1462.dist-info/RECORD,,
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
featrixsphere/__init__.py,sha256=7qEuBqtpDfJZYvEJQAVVrtdL-nZvI74oPx7tcVJN9Jo,1888
|
|
2
|
-
featrixsphere/cli.py,sha256=AW9O3vCvCNJ2UxVGN66eRmeN7XLSiHJlvK6JLZ9UJXc,13358
|
|
3
|
-
featrixsphere/client.py,sha256=NM-dBRANvN0GpcLf0BPqUxpqwMhzHP6hJktD8FndyCM,384646
|
|
4
|
-
featrixsphere/test_client.py,sha256=4SiRbib0ms3poK0UpnUv4G0HFQSzidF3Iswo_J2cjLk,11981
|
|
5
|
-
featrixsphere-0.2.1439.dist-info/METADATA,sha256=_KJ6nguFKv3xMG1kbWWS5_7hN2DjQEa-z3sloLIh5z4,16232
|
|
6
|
-
featrixsphere-0.2.1439.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
7
|
-
featrixsphere-0.2.1439.dist-info/entry_points.txt,sha256=QreJeYfD_VWvbEqPmMXZ3pqqlFlJ1qZb-NtqnyhEldc,51
|
|
8
|
-
featrixsphere-0.2.1439.dist-info/top_level.txt,sha256=AyN4wjfzlD0hWnDieuEHX0KckphIk_aC73XCG4df5uU,14
|
|
9
|
-
featrixsphere-0.2.1439.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|