Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -114,16 +114,13 @@ QUESTION_SET = [
|
|
114 |
|
115 |
# Function that load or initialize count.json
|
116 |
def load_or_initialize_count_json(audio_paths):
|
117 |
-
# Add filelock to /workspace/count.json
|
118 |
-
lock_path = COUNT_JSON_PATH + ".lock"
|
119 |
-
|
120 |
try:
|
121 |
# Only try downloading if file doesn't exist yet
|
122 |
if not os.path.exists(COUNT_JSON_PATH):
|
123 |
downloaded_path = hf_hub_download(
|
124 |
repo_id="intersteller2887/Turing-test-dataset",
|
125 |
repo_type="dataset",
|
126 |
-
filename=
|
127 |
token=os.getenv("HF_TOKEN")
|
128 |
)
|
129 |
# Save it as COUNT_JSON_PATH so that the lock logic remains untouched
|
@@ -131,6 +128,9 @@ def load_or_initialize_count_json(audio_paths):
|
|
131 |
dst.write(src.read())
|
132 |
except Exception as e:
|
133 |
print(f"Could not download or save count.json from HuggingFace dataset: {e}")
|
|
|
|
|
|
|
134 |
|
135 |
# Read of count.json will wait for 10 seconds until another thread involving releases it, and then add a lock to it
|
136 |
with FileLock(lock_path, timeout=10):
|
|
|
114 |
|
115 |
# Function that load or initialize count.json
|
116 |
def load_or_initialize_count_json(audio_paths):
|
|
|
|
|
|
|
117 |
try:
|
118 |
# Only try downloading if file doesn't exist yet
|
119 |
if not os.path.exists(COUNT_JSON_PATH):
|
120 |
downloaded_path = hf_hub_download(
|
121 |
repo_id="intersteller2887/Turing-test-dataset",
|
122 |
repo_type="dataset",
|
123 |
+
filename=COUNT_JSON_REPO_PATH,
|
124 |
token=os.getenv("HF_TOKEN")
|
125 |
)
|
126 |
# Save it as COUNT_JSON_PATH so that the lock logic remains untouched
|
|
|
128 |
dst.write(src.read())
|
129 |
except Exception as e:
|
130 |
print(f"Could not download or save count.json from HuggingFace dataset: {e}")
|
131 |
+
|
132 |
+
# Add filelock to /workspace/count.json
|
133 |
+
lock_path = COUNT_JSON_PATH + ".lock"
|
134 |
|
135 |
# Read of count.json will wait for 10 seconds until another thread involving releases it, and then add a lock to it
|
136 |
with FileLock(lock_path, timeout=10):
|