FocoosHUB
ApiClient
#
A simple HTTP client for making GET, POST, and DELETE requests.
This client is initialized with an API key and a host URL, and it automatically includes the API key in the headers of each request.
Attributes:
Name | Type | Description |
---|---|---|
api_key |
str
|
The API key for authorization. |
host_url |
str
|
The base URL for the API. |
default_headers |
dict
|
Default headers including authorization and user agent. |
Source code in focoos/hub/api_client.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 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 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 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 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 205 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 231 232 233 234 235 236 237 238 239 240 |
|
__init__(api_key=None, host_url=None)
#
Initialize the ApiClient with an API key and host URL.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
api_key
|
str
|
The API key for authorization. |
None
|
host_url
|
str
|
The base URL for the API. |
None
|
Source code in focoos/hub/api_client.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
|
delete(path, extra_headers=None)
#
Perform a DELETE request to the specified path on the host URL.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str
|
The URL path to request. |
required |
extra_headers
|
Optional[dict]
|
Additional headers to include in the request. Defaults to None. |
None
|
Returns:
Name | Type | Description |
---|---|---|
Response |
The response object from the requests library. |
Source code in focoos/hub/api_client.py
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 |
|
download_ext_file(uri, file_dir, file_name=None, skip_if_exists=False)
#
Download a file from a URI to a local directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
uri
|
str
|
The URI to download the file from |
required |
file_dir
|
str
|
Local directory to save the downloaded file |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
Path to the downloaded file |
Raises:
Type | Description |
---|---|
ValueError
|
If the download fails or filename cannot be determined |
Source code in focoos/hub/api_client.py
195 196 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 229 230 231 232 233 234 235 236 237 238 239 240 |
|
external_get(path, params=None, stream=False)
#
Perform a GET request to an external URL.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str
|
The URL path to request. |
required |
params
|
Optional[dict]
|
Query parameters for the request. Defaults to None. |
None
|
stream
|
bool
|
Whether to stream the response. Defaults to False. |
False
|
Returns:
Name | Type | Description |
---|---|---|
Response |
The response object from the requests library. |
Source code in focoos/hub/api_client.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
|
external_post(path, data=None, extra_headers=None, files=None, stream=False)
#
Perform a POST request to an external URL without using the default host URL.
This method is used for making POST requests to external services, such as file upload endpoints that require direct access without the base host URL prefix.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str
|
The complete URL to send the request to. |
required |
data
|
Optional[dict]
|
The JSON data to send in the request body. Defaults to None. |
None
|
extra_headers
|
Optional[dict]
|
Headers to include in the request. Defaults to None. |
None
|
files
|
optional
|
Files to send in the request. Defaults to None. |
None
|
Returns:
Name | Type | Description |
---|---|---|
Response |
The response object from the requests library. |
Source code in focoos/hub/api_client.py
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
|
get(path, params=None, extra_headers=None, stream=False)
#
Perform a GET request to the specified path on the host URL.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str
|
The URL path to request. |
required |
params
|
Optional[dict]
|
Query parameters for the request. Defaults to None. |
None
|
extra_headers
|
Optional[dict]
|
Additional headers to include in the request. Defaults to None. |
None
|
stream
|
bool
|
Whether to stream the response. Defaults to False. |
False
|
Returns:
Name | Type | Description |
---|---|---|
Response |
The response object from the requests library. |
Source code in focoos/hub/api_client.py
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 |
|
post(path, data=None, extra_headers=None, files=None)
#
Perform a POST request to the specified path on the host URL.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str
|
The URL path to request. |
required |
data
|
Optional[dict]
|
The JSON data to send in the request body. Defaults to None. |
None
|
extra_headers
|
Optional[dict]
|
Additional headers to include in the request. Defaults to None. |
None
|
files
|
optional
|
Files to send in the request. Defaults to None. |
None
|
Returns:
Name | Type | Description |
---|---|---|
Response |
The response object from the requests library. |
Source code in focoos/hub/api_client.py
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 |
|
upload_file(path, file_path, file_size)
#
Upload a file to the specified path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str
|
The API endpoint path to upload to |
required |
file_path
|
str
|
Path to the file to upload |
required |
file_size
|
int
|
Size of the file in bytes |
required |
Returns:
Name | Type | Description |
---|---|---|
Response |
The response from the upload request |
Source code in focoos/hub/api_client.py
180 181 182 183 184 185 186 187 188 189 190 191 192 193 |
|
Focoos Module
This module provides a Python interface for interacting with Focoos APIs, allowing users to manage machine learning models and datasets in the Focoos ecosystem. The module supports operations such as retrieving model metadata, downloading models, and listing shared datasets.
Classes:
Name | Description |
---|---|
FocoosHUB |
Main class to interface with Focoos APIs. |
Raises:
Type | Description |
---|---|
ValueError
|
Raised for invalid API responses or missing parameters. |
FocoosHUB
#
Main class to interface with Focoos APIs.
This class provides methods to interact with Focoos-hosted models and datasets. It supports functionalities such as listing models, retrieving model metadata, downloading models, and creating new models.
Attributes:
Name | Type | Description |
---|---|---|
api_key |
str
|
The API key for authentication. |
api_client |
ApiClient
|
HTTP client for making API requests. |
user_info |
User
|
Information about the currently authenticated user. |
host_url |
str
|
Base URL for the Focoos API. |
Source code in focoos/hub/focoos_hub.py
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 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 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 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 205 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 231 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 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 298 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 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 |
|
__init__(api_key=None, host_url=None)
#
Initializes the FocoosHUB client.
This client provides authenticated access to the Focoos API, enabling various operations through the configured HTTP client. It retrieves user information upon initialization and logs the environment details.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
api_key
|
Optional[str]
|
API key for authentication. Defaults to the |
None
|
host_url
|
Optional[str]
|
Base URL for the Focoos API. Defaults to the |
None
|
Raises:
Type | Description |
---|---|
ValueError
|
If the API key is not provided, or if the host URL is not specified in the arguments or the configuration. |
Attributes:
Name | Type | Description |
---|---|---|
api_key |
str
|
The API key used for authentication. |
api_client |
ApiClient
|
An HTTP client instance configured with the API key and host URL. |
user_info |
User
|
Information about the authenticated user retrieved from the API. |
host_url |
str
|
The base URL used for API requests. |
Logs
- Error if the API key or host URL is missing.
- Info about the authenticated user and environment upon successful initialization.
Example
1 2 3 |
|
Source code in focoos/hub/focoos_hub.py
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 90 91 92 93 94 95 96 97 98 99 100 101 |
|
download_model_pth(model_ref, skip_if_exists=True)
#
Downloads a model from the Focoos API.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_ref
|
str
|
Reference identifier for the model. |
required |
skip_if_exists
|
bool
|
If True, skips the download if the model file already exists. Defaults to True. |
True
|
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
Path to the downloaded model file. |
Raises:
Type | Description |
---|---|
ValueError
|
If the API request fails or the download fails. |
Source code in focoos/hub/focoos_hub.py
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 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 261 262 263 |
|
get_model_info(model_ref)
#
Retrieves metadata for a specific model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_ref
|
str
|
Reference identifier for the model. |
required |
Returns:
Name | Type | Description |
---|---|---|
RemoteModelInfo |
RemoteModelInfo
|
Metadata of the specified model. |
Raises:
Type | Description |
---|---|
ValueError
|
If the API request fails. |
Example
1 2 3 4 |
|
Source code in focoos/hub/focoos_hub.py
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
|
get_remote_dataset(ref)
#
Retrieves a remote dataset by its reference ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ref
|
str
|
The reference ID of the dataset to retrieve. |
required |
Returns:
Name | Type | Description |
---|---|---|
RemoteDataset |
RemoteDataset
|
A RemoteDataset instance for the specified reference. |
Example
1 2 3 4 |
|
Source code in focoos/hub/focoos_hub.py
311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 |
|
get_remote_model(model_ref)
#
Retrieves a remote model instance for cloud-based inference.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_ref
|
str
|
Reference identifier for the model. |
required |
Returns:
Name | Type | Description |
---|---|---|
RemoteModel |
RemoteModel
|
The remote model instance configured for cloud-based inference. |
Example
1 2 3 4 5 |
|
Source code in focoos/hub/focoos_hub.py
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 |
|
get_user_info()
#
Retrieves information about the authenticated user.
Returns:
Name | Type | Description |
---|---|---|
User |
User
|
User object containing account information and usage quotas. |
Raises:
Type | Description |
---|---|
ValueError
|
If the API request fails. |
Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
|
Source code in focoos/hub/focoos_hub.py
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 134 135 136 137 138 139 140 141 142 143 |
|
list_remote_datasets(include_shared=False)
#
Lists all datasets available to the user.
This method retrieves all datasets owned by the user and optionally includes shared datasets as well.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
include_shared
|
bool
|
If True, includes datasets shared with the user. Defaults to False. |
False
|
Returns:
Type | Description |
---|---|
list[DatasetPreview]
|
list[DatasetPreview]: A list of DatasetPreview objects representing the available datasets. |
Raises:
Type | Description |
---|---|
ValueError
|
If the API request to list datasets fails. |
Example
1 2 3 4 5 6 7 8 9 10 11 12 |
|
Source code in focoos/hub/focoos_hub.py
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 298 299 300 301 302 303 304 305 306 307 308 309 |
|
list_remote_models()
#
Lists all models owned by the user.
Returns:
Type | Description |
---|---|
list[ModelPreview]
|
list[ModelPreview]: List of model previews. |
Raises:
Type | Description |
---|---|
ValueError
|
If the API request fails. |
Example
1 2 3 4 |
|
Source code in focoos/hub/focoos_hub.py
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
|
new_model(model_info)
#
Creates a new model in the Focoos platform.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the new model. |
required |
focoos_model
|
str
|
Reference to the base Focoos model. |
required |
description
|
str
|
Description of the new model. |
required |
Returns:
Type | Description |
---|---|
RemoteModel
|
Optional[RemoteModel]: The created model instance, or None if creation fails. |
Raises:
Type | Description |
---|---|
ValueError
|
If the API request fails. |
Example
1 2 3 4 |
|
Source code in focoos/hub/focoos_hub.py
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 |
|
RemoteDataset
#
A class to manage remote datasets through the Focoos API.
This class provides functionality to interact with datasets stored remotely, including uploading, downloading, and managing dataset data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ref
|
str
|
The reference identifier for the dataset. |
required |
api_client
|
ApiClient
|
The API client instance for making requests. |
required |
Attributes:
Name | Type | Description |
---|---|---|
ref |
str
|
The dataset reference identifier. |
api_client |
ApiClient
|
The API client instance. |
metadata |
DatasetPreview
|
The dataset metadata. |
Source code in focoos/hub/remote_dataset.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 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 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 134 135 136 137 138 |
|
download_data(path=DATASETS_DIR)
#
Downloads the dataset data to a local path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str
|
Local path where the dataset should be downloaded. |
DATASETS_DIR
|
Returns:
Name | Type | Description |
---|---|---|
str |
The path where the file was downloaded. |
Raises:
Type | Description |
---|---|
ValueError
|
If the download fails. |
Source code in focoos/hub/remote_dataset.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
|
get_info()
#
Retrieves the dataset information from the API.
Returns:
Name | Type | Description |
---|---|---|
DatasetPreview |
DatasetPreview
|
The dataset preview information. |
Source code in focoos/hub/remote_dataset.py
33 34 35 36 37 38 39 40 41 42 43 |
|
upload_data(path)
#
Uploads dataset data from a local zip file to the remote storage.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str
|
Local path to the zip file containing dataset data. |
required |
Returns:
Type | Description |
---|---|
Optional[DatasetSpec]
|
Optional[DatasetSpec]: The dataset specification after successful upload. |
Raises:
Type | Description |
---|---|
FileNotFoundError
|
If the specified file does not exist. |
ValueError
|
If the file is not a zip file or upload fails. |
Source code in focoos/hub/remote_dataset.py
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 90 91 92 93 94 95 96 97 98 99 100 101 |
|
RemoteModel Module
This module provides a class to manage remote models in the Focoos ecosystem. It supports various functionalities including model training, deployment, inference, and monitoring.
Classes:
Name | Description |
---|---|
RemoteModel |
A class for interacting with remote models, managing their lifecycle, and performing inference. |
Functions:
Name | Description |
---|---|
__init__ |
Initializes the RemoteModel instance. |
get_info |
Retrieves model metadata. |
train |
Initiates model training. |
train_info |
Retrieves training status. |
train_logs |
Retrieves training logs. |
metrics |
Retrieves model metrics. |
RemoteModel
#
Represents a remote model in the Focoos platform.
Attributes:
Name | Type | Description |
---|---|---|
model_ref |
str
|
Reference ID for the model. |
api_client |
ApiClient
|
Client for making HTTP requests. |
model_info |
RemoteModelInfo
|
Model information of the model. |
Source code in focoos/hub/remote_model.py
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 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 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 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 205 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 231 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 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 298 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 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 |
|
__init__(model_ref, api_client)
#
Initialize the RemoteModel instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_ref
|
str
|
Reference ID for the model. |
required |
api_client
|
ApiClient
|
HTTP client instance for communication. |
required |
Raises:
Type | Description |
---|---|
ValueError
|
If model metadata retrieval fails. |
Source code in focoos/hub/remote_model.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
|
get_info()
#
Retrieve model metadata.
Returns:
Name | Type | Description |
---|---|---|
ModelMetadata |
RemoteModelInfo
|
Metadata of the model. |
Raises:
Type | Description |
---|---|
ValueError
|
If the request fails. |
Example
1 2 3 4 5 |
|
Source code in focoos/hub/remote_model.py
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 |
|
infer(image, threshold=0.5)
#
Perform inference on the provided image using the remote model.
This method sends an image to the remote model for inference and retrieves the detection results.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image
|
Union[str, Path, ndarray, bytes]
|
The image to infer on, which can be a file path, a string representing the path, a NumPy array, or raw bytes. |
required |
threshold
|
float
|
The confidence threshold for detections. Defaults to 0.5. Detections with confidence scores below this threshold will be discarded. |
0.5
|
Returns:
Name | Type | Description |
---|---|---|
FocoosDetections |
FocoosDetections
|
The detection results including class IDs, confidence scores, bounding boxes, and segmentation masks (if applicable). |
Raises:
Type | Description |
---|---|
FileNotFoundError
|
If the provided image file path is invalid. |
ValueError
|
If the inference request fails. |
Example
1 2 3 4 5 6 7 8 9 10 11 12 |
|
Source code in focoos/hub/remote_model.py
237 238 239 240 241 242 243 244 245 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 298 299 300 301 302 303 304 305 306 307 308 309 310 |
|
metrics()
#
Retrieve the metrics of the model.
This method sends a request to fetch the metrics of the model identified by model_ref
.
If the request is successful (status code 200), it returns the metrics as a Metrics
object.
If the request fails, it logs a warning and returns an empty Metrics
object.
Returns:
Name | Type | Description |
---|---|---|
Metrics |
Metrics
|
An object containing the metrics of the model. |
Raises:
Type | Description |
---|---|
None
|
Returns an empty |
Source code in focoos/hub/remote_model.py
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
|
notebook_monitor_train(interval=30, plot_metrics=False, max_runtime=36000)
#
Monitor the training process in a Jupyter notebook and display metrics.
Periodically checks the training status and displays metrics in a notebook cell. Clears previous output to maintain a clean view.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
interval
|
int
|
Time between status checks in seconds. Must be 30-240. Default: 30 |
30
|
plot_metrics
|
bool
|
Whether to plot metrics graphs. Default: False |
False
|
max_runtime
|
int
|
Maximum monitoring time in seconds. Default: 36000 (10 hours) |
36000
|
Returns:
Type | Description |
---|---|
None
|
None |
Source code in focoos/hub/remote_model.py
312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 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 |
|
train_info()
#
Retrieve the current status of the model training.
Sends a request to check the training status of the model referenced by self.model_ref
.
Returns:
Name | Type | Description |
---|---|---|
dict |
Optional[TrainingInfo]
|
A dictionary containing the training status information. |
Raises:
Type | Description |
---|---|
ValueError
|
If the request to get training status fails. |
Source code in focoos/hub/remote_model.py
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 |
|
train_logs()
#
Retrieve the training logs for the model.
This method sends a request to fetch the logs of the model's training process. If the request is successful (status code 200), it returns the logs as a list of strings. If the request fails, it logs a warning and returns an empty list.
Returns:
Type | Description |
---|---|
list[str]
|
list[str]: A list of training logs as strings. |
Raises:
Type | Description |
---|---|
None
|
Returns an empty list if the request fails. |
Source code in focoos/hub/remote_model.py
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 |
|