Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use fsspec and torch for embedding file IO #1581

Merged
merged 8 commits into from
Jun 1, 2022
Merged

Conversation

erogol
Copy link
Member

@erogol erogol commented May 19, 2022

No description provided.

Copy link
Contributor

@Edresson Edresson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that will be necessary to update the docs and run examples on the compute embeddings script (now it is not .json anymore)

Copy link
Contributor

@WeberJulian WeberJulian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also need to do changes in the bin/compute_embedding.py file, like here for exemple.

if ".json" not in args.output_path:

@erogol
Copy link
Member Author

erogol commented May 30, 2022

.json still works but we should switch to .pth for all the benefits.



def save_file(obj: Any, path:str):
with fsspec.open(path, "rb") as f:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you meant "wb" here right @erogol ?

@@ -22,11 +23,13 @@
parser.add_argument("config_dataset_path", type=str, help="Path to dataset config file.")
parser.add_argument("--output_path", type=str, help="Path for output `pth` or `json` file.", default="speakers.pth")
parser.add_argument("--old_file", type=str, help="Previous embedding file to only compute new audios.", default=None)
parser.add_argument("--use_cuda", type=bool, help="flag to set cuda. Default False", default=False)
parser.add_argument("--disable_cuda", type=bool, help="Flag to disable cuda.", default=False)
Copy link
Member Author

@erogol erogol May 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me, this is counter-intuitive but can live with it :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just spent 3h computing phonemes before realizing that it wasn't using the GPU ^^' That's why I changed it to that. Having use_cuda to true by default and then throwing errors if you had no GPU seemed bad...

@WeberJulian WeberJulian requested a review from Edresson June 1, 2022 09:48
@WeberJulian WeberJulian merged commit f70e82c into dev Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants