pedrocas15 commited on
Commit
e069448
·
verified ·
1 Parent(s): 0be59b5

Update rpc.py

Browse files
Files changed (1) hide show
  1. rpc.py +3 -5
rpc.py CHANGED
@@ -199,8 +199,6 @@ def generate(text, use_rpc=True, max_tokens=128):
199
  tok = tf.argmax(res, axis=-1).numpy().tolist()
200
 
201
  enc_text += [tok]
202
- new_text = tokenizer.decode(enc_text)
203
- tok_str = new_text[len(text):]
204
- text = new_text
205
-
206
- yield tok_str
 
199
  tok = tf.argmax(res, axis=-1).numpy().tolist()
200
 
201
  enc_text += [tok]
202
+ response = tokenizer.decode(enc_text)
203
+
204
+ yield response