Limour commited on
Commit
b1cbb3c
1 Parent(s): 717d707

Upload 4 files

Browse files
mods/btn_com.py CHANGED
@@ -101,8 +101,10 @@ def init(cfg):
101
  if cfg['session_active'] != finish:
102
  raise RuntimeError('任务中断!请稍等或Reset,如已Reset,请忽略。')
103
  cfg['session_active'] = not cfg['session_active']
 
 
 
104
  cfg['btn_stop_status'] = finish
105
- return tmp
106
 
107
  return _inner
108
 
 
101
  if cfg['session_active'] != finish:
102
  raise RuntimeError('任务中断!请稍等或Reset,如已Reset,请忽略。')
103
  cfg['session_active'] = not cfg['session_active']
104
+ yield tmp
105
+ if finish and cfg['btn_stop_status']:
106
+ raise RuntimeError('Stop或Reset被按下,任务已中断!如非您所为,可能他人正在使用中!')
107
  cfg['btn_stop_status'] = finish
 
108
 
109
  return _inner
110
 
mods/btn_submit.py CHANGED
@@ -44,6 +44,8 @@ def init(cfg):
44
  model.eval_t(t_msg, _n_keep, _n_discard)
45
  yield history, model.venv_info
46
  # ========== 模型输出 ==========
 
 
47
  model.venv_create('char')
48
  _tmp = btn_com(_n_keep, _n_discard,
49
  _temperature, _repeat_penalty, _frequency_penalty,
 
44
  model.eval_t(t_msg, _n_keep, _n_discard)
45
  yield history, model.venv_info
46
  # ========== 模型输出 ==========
47
+ if cfg['btn_stop_status']:
48
+ return
49
  model.venv_create('char')
50
  _tmp = btn_com(_n_keep, _n_discard,
51
  _temperature, _repeat_penalty, _frequency_penalty,
mods/btn_suggest.py CHANGED
@@ -16,6 +16,9 @@ def init(cfg):
16
  with lock:
17
  if not cfg['session_active']:
18
  raise RuntimeError
 
 
 
19
  # ========== 模型输出建议 ==========
20
  model.venv_create('suggest') # 创建隔离环境
21
  _tmp = btn_com(_n_keep, _n_discard,
 
16
  with lock:
17
  if not cfg['session_active']:
18
  raise RuntimeError
19
+ if cfg['btn_stop_status']:
20
+ yield '', model.venv_info
21
+ return
22
  # ========== 模型输出建议 ==========
23
  model.venv_create('suggest') # 创建隔离环境
24
  _tmp = btn_com(_n_keep, _n_discard,
mods/btn_vo.py CHANGED
@@ -16,6 +16,9 @@ def init(cfg):
16
  with lock:
17
  if not cfg['session_active']:
18
  raise RuntimeError
 
 
 
19
  # ========== 及时清理上一次生成的旁白 ==========
20
  model.venv_remove('vo')
21
  print('清理旁白', model.venv_info)
 
16
  with lock:
17
  if not cfg['session_active']:
18
  raise RuntimeError
19
+ if cfg['btn_stop_status']:
20
+ yield '', model.venv_info
21
+ return
22
  # ========== 及时清理上一次生成的旁白 ==========
23
  model.venv_remove('vo')
24
  print('清理旁白', model.venv_info)