Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,7 +13,7 @@ from huggingface_hub import HfApi, hf_hub_download
|
|
| 13 |
from multiprocessing import TimeoutError
|
| 14 |
from concurrent.futures import ThreadPoolExecutor, TimeoutError as FutureTimeoutError
|
| 15 |
|
| 16 |
-
dataset = load_dataset("intersteller2887/Turing-test-dataset", split="train")
|
| 17 |
dataset = dataset.cast_column("audio", Audio(decode=False)) # Prevent calling 'torchcodec' from newer version of 'datasets'
|
| 18 |
|
| 19 |
# Huggingface space working directory: "/home/user/app"
|
|
@@ -125,7 +125,7 @@ def load_or_initialize_count_json(audio_paths):
|
|
| 125 |
# Only try downloading if file doesn't exist yet
|
| 126 |
if not os.path.exists(COUNT_JSON_PATH):
|
| 127 |
downloaded_path = hf_hub_download(
|
| 128 |
-
repo_id="intersteller2887/Turing-test-dataset",
|
| 129 |
repo_type="dataset",
|
| 130 |
filename=COUNT_JSON_REPO_PATH,
|
| 131 |
token=os.getenv("HF_TOKEN")
|
|
@@ -672,7 +672,7 @@ def submit_question_and_advance(q_idx, d_idx, selections, final_choice, all_resu
|
|
| 672 |
print(f"上传出错: {e}")"""
|
| 673 |
|
| 674 |
def save_all_results_to_file(all_results, user_data, count_data=None):
|
| 675 |
-
repo_id = "intersteller2887/Turing-test-dataset"
|
| 676 |
username = user_data.get("username", "user")
|
| 677 |
timestamp = pd.Timestamp.now().strftime('%Y%m%d_%H%M%S')
|
| 678 |
submission_filename = f"submissions_{username}_{timestamp}.json"
|
|
|
|
| 13 |
from multiprocessing import TimeoutError
|
| 14 |
from concurrent.futures import ThreadPoolExecutor, TimeoutError as FutureTimeoutError
|
| 15 |
|
| 16 |
+
dataset = load_dataset("intersteller2887/Turing-test-dataset-en", split="train")
|
| 17 |
dataset = dataset.cast_column("audio", Audio(decode=False)) # Prevent calling 'torchcodec' from newer version of 'datasets'
|
| 18 |
|
| 19 |
# Huggingface space working directory: "/home/user/app"
|
|
|
|
| 125 |
# Only try downloading if file doesn't exist yet
|
| 126 |
if not os.path.exists(COUNT_JSON_PATH):
|
| 127 |
downloaded_path = hf_hub_download(
|
| 128 |
+
repo_id="intersteller2887/Turing-test-dataset-en",
|
| 129 |
repo_type="dataset",
|
| 130 |
filename=COUNT_JSON_REPO_PATH,
|
| 131 |
token=os.getenv("HF_TOKEN")
|
|
|
|
| 672 |
print(f"上传出错: {e}")"""
|
| 673 |
|
| 674 |
def save_all_results_to_file(all_results, user_data, count_data=None):
|
| 675 |
+
repo_id = "intersteller2887/Turing-test-dataset-en"
|
| 676 |
username = user_data.get("username", "user")
|
| 677 |
timestamp = pd.Timestamp.now().strftime('%Y%m%d_%H%M%S')
|
| 678 |
submission_filename = f"submissions_{username}_{timestamp}.json"
|