简体   繁体   English

Google Cloud 上的 Spleeter 函数

[英]Spleeter on Google Cloud Functions

Im trying to run spleeter lib on Google Cloud Functions.我试图在 Google Cloud Functions 上运行spleeter lib I have a problem.我有个问题。 The separate_to_file function is creating pretrained_models files while executing in root folder.在根文件夹中执行时, separate_to_file function 正在创建 pretrained_models 文件。 The only directory I can write something is /tmp .我可以写的唯一目录是/tmp Is there any way to change directory of pretrained models?有没有办法改变预训练模型的目录?

You can set the MODEL_DIRECTORY environment variable to the path of the directory you want models to be written into before to run Spleeter.您可以将MODEL_DIRECTORY环境变量设置为您希望在运行 Spleeter 之前写入模型的目录的路径。 Please note that most models are quite heavy and may require lot of storage.请注意,大多数型号都很重,可能需要大量存储空间。

I was doing the same thing.我也在做同样的事情。 Fetching the models can be solved by pointing to the /tmp directory, as already pointed out.正如已经指出的那样,可以通过指向 /tmp 目录来解决获取模型的问题。

Unfortunately, that wasn't the end of it.不幸的是,这还没有结束。 Spleeter depends on linux binaries that weren't included in serverless enironments. Spleeter 依赖于未包含在无服务器环境中的 linux 二进制文件。 I solved this by deploying a docker image instead of a plain script.我通过部署 docker 映像而不是纯脚本解决了这个问题。

Then there was the issue that spleeter consumes a lot of memory, especially for 4-way and 5-way splits.然后是 spleeter 消耗大量 memory 的问题,特别是对于 4 路和 5 路拆分。 Google Cloud doesn't offer enough RAM. Google Cloud 没有提供足够的 RAM。 AWS Lambdas offer 10GB RAM, which is enough to split a regular, radio-friendly song. AWS Lambdas 提供 10GB RAM,足以分割一首普通的无线电友好歌曲。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM