Spaces:
Running
on
Zero
Running
on
Zero
Update main.py
Browse files
main.py
CHANGED
@@ -8,6 +8,7 @@ import json # to work with JSON
|
|
8 |
import datasets # to load the dataset
|
9 |
import spaces # for GPU
|
10 |
import threading
|
|
|
11 |
|
12 |
# Load the dataset and convert to pandas
|
13 |
full_data = datasets.load_dataset("ccm/publications")["train"].to_pandas()
|
@@ -111,6 +112,7 @@ def predict(message: str, history: list[str]) -> str:
|
|
111 |
for new_token in streamer:
|
112 |
if new_token != '<':
|
113 |
partial_message += new_token
|
|
|
114 |
yield partial_message
|
115 |
|
116 |
yield partial_message + bypass
|
|
|
8 |
import datasets # to load the dataset
|
9 |
import spaces # for GPU
|
10 |
import threading
|
11 |
+
import time
|
12 |
|
13 |
# Load the dataset and convert to pandas
|
14 |
full_data = datasets.load_dataset("ccm/publications")["train"].to_pandas()
|
|
|
112 |
for new_token in streamer:
|
113 |
if new_token != '<':
|
114 |
partial_message += new_token
|
115 |
+
time.sleep(0.05)
|
116 |
yield partial_message
|
117 |
|
118 |
yield partial_message + bypass
|