Spaces:
Paused
Paused
Commit
·
7e854d5
1
Parent(s):
5f94267
Update answerer.py
Browse files- answerer.py +4 -4
answerer.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
from typing import Dict,
|
| 2 |
import os, gc
|
| 3 |
from rwkv.model import RWKV
|
| 4 |
from rwkv.utils import PIPELINE, PIPELINE_ARGS
|
|
@@ -20,7 +20,7 @@ class Answerer:
|
|
| 20 |
repetitiveness = .3,
|
| 21 |
diversity = 0,
|
| 22 |
_count_penalty = 1,
|
| 23 |
-
)
|
| 24 |
args = PIPELINE_ARGS(
|
| 25 |
temperature=chaos,
|
| 26 |
top_p=repetitiveness,
|
|
@@ -67,7 +67,7 @@ class Answerer:
|
|
| 67 |
if "\ufffd" not in tmp:
|
| 68 |
tokens.clear()
|
| 69 |
result += tmp
|
| 70 |
-
yield result
|
| 71 |
|
| 72 |
tokens.clear()
|
| 73 |
occurrences.clear()
|
|
@@ -75,5 +75,5 @@ class Answerer:
|
|
| 75 |
del occurrences, tokens, current_token, state
|
| 76 |
gc.collect()
|
| 77 |
|
| 78 |
-
yield result
|
| 79 |
|
|
|
|
| 1 |
+
from typing import Dict, List
|
| 2 |
import os, gc
|
| 3 |
from rwkv.model import RWKV
|
| 4 |
from rwkv.utils import PIPELINE, PIPELINE_ARGS
|
|
|
|
| 20 |
repetitiveness = .3,
|
| 21 |
diversity = 0,
|
| 22 |
_count_penalty = 1,
|
| 23 |
+
):
|
| 24 |
args = PIPELINE_ARGS(
|
| 25 |
temperature=chaos,
|
| 26 |
top_p=repetitiveness,
|
|
|
|
| 67 |
if "\ufffd" not in tmp:
|
| 68 |
tokens.clear()
|
| 69 |
result += tmp
|
| 70 |
+
yield result
|
| 71 |
|
| 72 |
tokens.clear()
|
| 73 |
occurrences.clear()
|
|
|
|
| 75 |
del occurrences, tokens, current_token, state
|
| 76 |
gc.collect()
|
| 77 |
|
| 78 |
+
yield result
|
| 79 |
|