Spaces:
Runtime error
Runtime error
Upload btn_vo.py
Browse files- mods/btn_vo.py +3 -3
mods/btn_vo.py
CHANGED
@@ -12,7 +12,7 @@ def init(cfg):
|
|
12 |
_top_p, _min_p, _typical_p,
|
13 |
_tfs_z, _mirostat_mode, _mirostat_eta,
|
14 |
_mirostat_tau, _usr, _char,
|
15 |
-
_rag, _max_tokens):
|
16 |
with lock:
|
17 |
if not cfg['session_active']:
|
18 |
raise RuntimeError
|
@@ -30,13 +30,13 @@ def init(cfg):
|
|
30 |
for _h in _tmp:
|
31 |
yield _h, model.venv_info
|
32 |
# ========== 及时清理上一次生成的旁白 ==========
|
33 |
-
model.venv_remove('vo', keep_last=
|
34 |
yield _h, model.venv_info
|
35 |
print('清理旁白', model.venv_info)
|
36 |
|
37 |
cfg['btn_vo_fn'] = {
|
38 |
'fn': btn_vo,
|
39 |
-
'inputs': cfg['setting'],
|
40 |
'outputs': [cfg['vo'], s_info]
|
41 |
}
|
42 |
cfg['btn_vo_fn'].update(cfg['btn_concurrency'])
|
|
|
12 |
_top_p, _min_p, _typical_p,
|
13 |
_tfs_z, _mirostat_mode, _mirostat_eta,
|
14 |
_mirostat_tau, _usr, _char,
|
15 |
+
_rag, _max_tokens, _keep_last: int):
|
16 |
with lock:
|
17 |
if not cfg['session_active']:
|
18 |
raise RuntimeError
|
|
|
30 |
for _h in _tmp:
|
31 |
yield _h, model.venv_info
|
32 |
# ========== 及时清理上一次生成的旁白 ==========
|
33 |
+
model.venv_remove('vo', keep_last=_keep_last)
|
34 |
yield _h, model.venv_info
|
35 |
print('清理旁白', model.venv_info)
|
36 |
|
37 |
cfg['btn_vo_fn'] = {
|
38 |
'fn': btn_vo,
|
39 |
+
'inputs': cfg['setting'] + [cfg['setting_btn_vo_keep_last']],
|
40 |
'outputs': [cfg['vo'], s_info]
|
41 |
}
|
42 |
cfg['btn_vo_fn'].update(cfg['btn_concurrency'])
|