davda54 commited on
Commit
c55a83f
1 Parent(s): 500ab62

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -41,6 +41,8 @@ LANGUAGE_IDS = {
41
 
42
  class BatchStreamer(TextIteratorStreamer):
43
  def put(self, value):
 
 
44
  #if value.size(0) == 1:
45
  # return super().put(value)
46
 
@@ -51,7 +53,7 @@ class BatchStreamer(TextIteratorStreamer):
51
 
52
  # Add the new token to the cache and decodes the entire thing.
53
  for c, v in zip(self.token_cache, value):
54
- c += v
55
 
56
  paragraphs = [tokenizer.decode(c, **self.decode_kwargs).strip() for c in self.token_cache]
57
  text = '\n'.join(paragraphs)
 
41
 
42
  class BatchStreamer(TextIteratorStreamer):
43
  def put(self, value):
44
+ print(value.shape)
45
+
46
  #if value.size(0) == 1:
47
  # return super().put(value)
48
 
 
53
 
54
  # Add the new token to the cache and decodes the entire thing.
55
  for c, v in zip(self.token_cache, value):
56
+ c.append(v)
57
 
58
  paragraphs = [tokenizer.decode(c, **self.decode_kwargs).strip() for c in self.token_cache]
59
  text = '\n'.join(paragraphs)