mirror of
https://github.com/w-okada/voice-changer.git
synced 2025-01-24 05:55:01 +03:00
16 lines
502 B
Python
Executable File
16 lines
502 B
Python
Executable File
from fastapi.responses import JSONResponse
|
|
from fastapi.encoders import jsonable_encoder
|
|
from trainer_mods.files import get_dir_list
|
|
import os
|
|
# CreateはFileUploaderで実装。
|
|
|
|
def mod_get_speakers():
|
|
os.makedirs("MMVC_Trainer/dataset/textful", exist_ok=True)
|
|
speakers = get_dir_list("MMVC_Trainer/dataset/textful/")
|
|
|
|
data = {
|
|
"speakers":sorted(speakers)
|
|
}
|
|
json_compatible_item_data = jsonable_encoder(data)
|
|
return JSONResponse(content=json_compatible_item_data)
|