utils¶
feat.utils
¶
py-feat helper functions and variables
flatten_list(data)
¶
generate_coordinate_names(num_points=478)
¶
Generates a list of names for x, y, z coordinates for a given number of points.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
num_points
|
int
|
Number of points (478 in this case). |
478
|
Returns:
| Name | Type | Description |
|---|---|---|
list |
List of coordinate names like ['x_1', 'y_1', 'z_1', ..., 'x_n', 'y_n', 'z_n']. |
Source code in feat/utils/__init__.py
hf_hub_download_with_fallback(repo_id, filename, fallback_filename, cache_dir)
¶
Download filename from HuggingFace; on miss, download fallback_filename.
Used to roll out new model file versions without breaking installs in the window between a code release and the artifact upload. Once the new file is reliably present on the hub, the fallback path is dead code; once the old file is removed, the fallback path errors. Both are good outcomes.
Returns the local path of whichever file was successfully downloaded.
Source code in feat/utils/__init__.py
set_torch_device(device='cpu')
¶
Helper function to set device for pytorch model