Update app.py
Browse files
app.py
CHANGED
@@ -203,10 +203,10 @@ else:
|
|
203 |
)
|
204 |
if if_gpu_ok == True and len(gpu_infos) > 0:
|
205 |
gpu_info = "\n".join(gpu_infos)
|
206 |
-
default_batch_size = min(mem) //
|
207 |
else:
|
208 |
gpu_info = i18n("很遗憾您这没有能用的显卡来支持您训练")
|
209 |
-
default_batch_size =
|
210 |
gpus = "-".join([i[0] for i in gpu_infos])
|
211 |
from lib.infer_pack.models import (
|
212 |
SynthesizerTrnMs256NSFsid,
|
@@ -905,7 +905,7 @@ def train_index(exp_dir1, version19):
|
|
905 |
# faiss.write_index(index, '%s/trained_IVF%s_Flat_FastScan_%s.index'%(exp_dir,n_ivf,version19))
|
906 |
infos.append("adding")
|
907 |
yield "\n".join(infos)
|
908 |
-
batch_size_add =
|
909 |
for i in range(0, big_npy.shape[0], batch_size_add):
|
910 |
index.add(big_npy[i : i + batch_size_add])
|
911 |
faiss.write_index(
|
@@ -1145,7 +1145,7 @@ def train1key(
|
|
1145 |
% (model_log_dir, n_ivf, index_ivf.nprobe, exp_dir1, version19),
|
1146 |
)
|
1147 |
yield get_info_str("adding index")
|
1148 |
-
batch_size_add =
|
1149 |
for i in range(0, big_npy.shape[0], batch_size_add):
|
1150 |
index.add(big_npy[i : i + batch_size_add])
|
1151 |
faiss.write_index(
|
|
|
203 |
)
|
204 |
if if_gpu_ok == True and len(gpu_infos) > 0:
|
205 |
gpu_info = "\n".join(gpu_infos)
|
206 |
+
default_batch_size = min(mem) // 2
|
207 |
else:
|
208 |
gpu_info = i18n("很遗憾您这没有能用的显卡来支持您训练")
|
209 |
+
default_batch_size = 1
|
210 |
gpus = "-".join([i[0] for i in gpu_infos])
|
211 |
from lib.infer_pack.models import (
|
212 |
SynthesizerTrnMs256NSFsid,
|
|
|
905 |
# faiss.write_index(index, '%s/trained_IVF%s_Flat_FastScan_%s.index'%(exp_dir,n_ivf,version19))
|
906 |
infos.append("adding")
|
907 |
yield "\n".join(infos)
|
908 |
+
batch_size_add = 16384
|
909 |
for i in range(0, big_npy.shape[0], batch_size_add):
|
910 |
index.add(big_npy[i : i + batch_size_add])
|
911 |
faiss.write_index(
|
|
|
1145 |
% (model_log_dir, n_ivf, index_ivf.nprobe, exp_dir1, version19),
|
1146 |
)
|
1147 |
yield get_info_str("adding index")
|
1148 |
+
batch_size_add = 16384
|
1149 |
for i in range(0, big_npy.shape[0], batch_size_add):
|
1150 |
index.add(big_npy[i : i + batch_size_add])
|
1151 |
faiss.write_index(
|