Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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
|
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)
|