Spaces:
Running
on
Zero
Running
on
Zero
Show runs
Browse files
app.py
CHANGED
@@ -6,14 +6,16 @@ from cache_system import CacheHandler
|
|
6 |
from gradio_client import Client
|
7 |
from collections import OrderedDict
|
8 |
from typing import Any
|
|
|
9 |
|
10 |
-
print(f"CPU cores: {os.cpu_count()}.")
|
11 |
|
12 |
server = os.environ.get("SERVER") or True
|
13 |
auth_token = os.environ.get("TOKEN") or True
|
14 |
|
15 |
client = Client(server, hf_token=auth_token, verbose=False)
|
16 |
|
|
|
|
|
17 |
|
18 |
class HuggingFaceDatasetSaver_custom(gr.HuggingFaceDatasetSaver):
|
19 |
def _deserialize_components(
|
@@ -53,6 +55,10 @@ def generate_text(
|
|
53 |
url: str, mode: int, progress=gr.Progress(track_tqdm=False)
|
54 |
) -> (str, str):
|
55 |
global cache_handler
|
|
|
|
|
|
|
|
|
56 |
|
57 |
url = url.strip()
|
58 |
|
|
|
6 |
from gradio_client import Client
|
7 |
from collections import OrderedDict
|
8 |
from typing import Any
|
9 |
+
import datetime
|
10 |
|
|
|
11 |
|
12 |
server = os.environ.get("SERVER") or True
|
13 |
auth_token = os.environ.get("TOKEN") or True
|
14 |
|
15 |
client = Client(server, hf_token=auth_token, verbose=False)
|
16 |
|
17 |
+
total_runs = 0
|
18 |
+
|
19 |
|
20 |
class HuggingFaceDatasetSaver_custom(gr.HuggingFaceDatasetSaver):
|
21 |
def _deserialize_components(
|
|
|
55 |
url: str, mode: int, progress=gr.Progress(track_tqdm=False)
|
56 |
) -> (str, str):
|
57 |
global cache_handler
|
58 |
+
global total_runs
|
59 |
+
|
60 |
+
total_runs += 1
|
61 |
+
print(f"Total runs: {total_runs}. Last run: {datetime.datetime.now()}")
|
62 |
|
63 |
url = url.strip()
|
64 |
|