Spaces:
Runtime error
Runtime error
ffreemt
commited on
Commit
·
8759d6a
1
Parent(s):
d8b0712
Update testing stream and recoding time
Browse files
app.py
CHANGED
|
@@ -25,6 +25,8 @@ ns = SimpleNamespace(response="")
|
|
| 25 |
|
| 26 |
def predict0(prompt, bot):
|
| 27 |
# logger.debug(f"{prompt=}, {bot=}, {timeout=}")
|
|
|
|
|
|
|
| 28 |
logger.debug(f"{prompt=}, {bot=}")
|
| 29 |
ns.response = ""
|
| 30 |
with about_time() as atime:
|
|
@@ -35,7 +37,10 @@ def predict0(prompt, bot):
|
|
| 35 |
|
| 36 |
response = ""
|
| 37 |
buff.update(value="diggin...")
|
| 38 |
-
bot
|
|
|
|
|
|
|
|
|
|
| 39 |
for word in generator:
|
| 40 |
print(word, end="", flush=True)
|
| 41 |
response += word
|
|
@@ -53,7 +58,7 @@ def predict0(prompt, bot):
|
|
| 53 |
f"(time elapsed: {atime.duration_human}, "
|
| 54 |
f"{atime.duration/(len(prompt) + len(response))} s/char)"
|
| 55 |
)
|
| 56 |
-
bot = [(prompt, f"{response} {_}")]
|
| 57 |
|
| 58 |
return prompt, bot
|
| 59 |
|
|
|
|
| 25 |
|
| 26 |
def predict0(prompt, bot):
|
| 27 |
# logger.debug(f"{prompt=}, {bot=}, {timeout=}")
|
| 28 |
+
_ = ("", "")
|
| 29 |
+
bot.append(_)
|
| 30 |
logger.debug(f"{prompt=}, {bot=}")
|
| 31 |
ns.response = ""
|
| 32 |
with about_time() as atime:
|
|
|
|
| 37 |
|
| 38 |
response = ""
|
| 39 |
buff.update(value="diggin...")
|
| 40 |
+
if bot:
|
| 41 |
+
bot[-1] = [(prompt, "diggin...")]
|
| 42 |
+
else:
|
| 43 |
+
bot = [(prompt, "diggin...")]
|
| 44 |
for word in generator:
|
| 45 |
print(word, end="", flush=True)
|
| 46 |
response += word
|
|
|
|
| 58 |
f"(time elapsed: {atime.duration_human}, "
|
| 59 |
f"{atime.duration/(len(prompt) + len(response))} s/char)"
|
| 60 |
)
|
| 61 |
+
bot[-1] = [(prompt, f"{response} {_}")]
|
| 62 |
|
| 63 |
return prompt, bot
|
| 64 |
|