DaniilAlpha commited on
Commit
0dc748d
·
1 Parent(s): 1df84d8

Update answerer.py

Browse files
Files changed (1) hide show
  1. answerer.py +3 -3
answerer.py CHANGED
@@ -20,6 +20,7 @@ class Answerer:
20
  repetitiveness = .3,
21
  diversity = 0,
22
  _count_penalty = 1,
 
23
  ):
24
  args = PIPELINE_ARGS(
25
  temperature=chaos,
@@ -67,8 +68,7 @@ class Answerer:
67
  if "\ufffd" not in tmp:
68
  tokens.clear()
69
  result += tmp
70
- print(f"yielt: '{result}'")
71
- yield result
72
 
73
  tokens.clear()
74
  occurrences.clear()
@@ -76,5 +76,5 @@ class Answerer:
76
  del occurrences, tokens, current_token, state
77
  gc.collect()
78
 
79
- yield result
80
 
 
20
  repetitiveness = .3,
21
  diversity = 0,
22
  _count_penalty = 1,
23
+ callback = None,
24
  ):
25
  args = PIPELINE_ARGS(
26
  temperature=chaos,
 
68
  if "\ufffd" not in tmp:
69
  tokens.clear()
70
  result += tmp
71
+ if(callback) callback(result)
 
72
 
73
  tokens.clear()
74
  occurrences.clear()
 
76
  del occurrences, tokens, current_token, state
77
  gc.collect()
78
 
79
+ return result
80