DaniilAlpha commited on
Commit
64438c0
·
1 Parent(s): cc38217

Update answerer.py

Browse files
Files changed (1) hide show
  1. answerer.py +3 -3
answerer.py CHANGED
@@ -1,4 +1,4 @@
1
- from typing import Dict, Generator, List
2
  import os, gc
3
  from huggingface_hub import hf_hub_download
4
  from rwkv.model import RWKV
@@ -13,7 +13,7 @@ class Answerer:
13
  self.__pipeline = PIPELINE(self.__model, vocab)
14
  self.ctx_limit = ctx_limit
15
 
16
- def __call__(
17
  self,
18
  input: str,
19
  max_output_length_tk: int,
@@ -21,7 +21,7 @@ class Answerer:
21
  repetitiveness = .3,
22
  diversity = 0,
23
  _count_penalty = 1,
24
- ) -> Generator[str, None, None]:
25
  args = PIPELINE_ARGS(
26
  temperature=chaos,
27
  top_p=repetitiveness,
 
1
+ from typing import Dict, AsyncGenerator, List
2
  import os, gc
3
  from huggingface_hub import hf_hub_download
4
  from rwkv.model import RWKV
 
13
  self.__pipeline = PIPELINE(self.__model, vocab)
14
  self.ctx_limit = ctx_limit
15
 
16
+ async def __call__(
17
  self,
18
  input: str,
19
  max_output_length_tk: int,
 
21
  repetitiveness = .3,
22
  diversity = 0,
23
  _count_penalty = 1,
24
+ ) -> AsyncGenerator[str, None]:
25
  args = PIPELINE_ARGS(
26
  temperature=chaos,
27
  top_p=repetitiveness,