Spaces:
Runtime error
Runtime error
Commit
·
9c4c263
1
Parent(s):
a889160
another repo test
Browse files
app.py
CHANGED
@@ -19,7 +19,7 @@ GREETINGS_DIR = './greetings'
|
|
19 |
greeting_files = [f.name for f in os.scandir(GREETINGS_DIR)]
|
20 |
|
21 |
|
22 |
-
DATASET_REPO_URL = "https://huggingface.co/datasets/meyabase/
|
23 |
REPOSITORY_DIR = "data"
|
24 |
LOCAL_DIR = 'data_local'
|
25 |
os.makedirs(LOCAL_DIR,exist_ok=True)
|
@@ -89,7 +89,7 @@ def save_record(language,record,greeting,gender,accent,greeting_history,current_
|
|
89 |
|
90 |
_ = upload_file(path_or_fileobj = audio_output_filename,
|
91 |
path_in_repo =repo_audio_path,
|
92 |
-
repo_id='meyabase/
|
93 |
repo_type='dataset',
|
94 |
token=HF_TOKEN
|
95 |
)
|
@@ -98,7 +98,7 @@ def save_record(language,record,greeting,gender,accent,greeting_history,current_
|
|
98 |
repo_json_path = os.path.join(REPOSITORY_DIR,os.path.join(audio_name,'metadata.jsonl'))
|
99 |
_ = upload_file(path_or_fileobj = json_file_path,
|
100 |
path_in_repo =repo_json_path,
|
101 |
-
repo_id='meyabase/
|
102 |
repo_type='dataset',
|
103 |
token=HF_TOKEN
|
104 |
)
|
@@ -166,7 +166,7 @@ def get_metadata_of_dataset():
|
|
166 |
repo_recordings = [os.path.join(REPOSITORY_DATA_DIR,f.name) for f in os.scandir(REPOSITORY_DATA_DIR)] if os.path.isdir(REPOSITORY_DATA_DIR) else []
|
167 |
|
168 |
audio_repo = [os.path.join(f,'audio.wav') for f in repo_recordings]
|
169 |
-
audio_repo = [a.replace('data/data/','https://huggingface.co/datasets/meyabase/
|
170 |
metadata_all = [get_metadata_json(os.path.join(f,'metadata.jsonl')) for f in repo_recordings]
|
171 |
metadata_all = [m for m in metadata_all if m!=[]]
|
172 |
return metadata_all
|
@@ -177,7 +177,7 @@ def display_records():
|
|
177 |
repo_recordings = [os.path.join(REPOSITORY_DATA_DIR,f.name) for f in os.scandir(REPOSITORY_DATA_DIR)] if os.path.isdir(REPOSITORY_DATA_DIR) else []
|
178 |
|
179 |
audio_repo = [os.path.join(f,'audio.wav') for f in repo_recordings]
|
180 |
-
audio_repo = [a.replace('data/data/','https://huggingface.co/datasets/meyabase/
|
181 |
metadata_repo = [read_json_lines(os.path.join(f,'metadata.jsonl'))[0] for f in repo_recordings]
|
182 |
audios_all = audio_repo
|
183 |
metadata_all = metadata_repo
|
|
|
19 |
greeting_files = [f.name for f in os.scandir(GREETINGS_DIR)]
|
20 |
|
21 |
|
22 |
+
DATASET_REPO_URL = "https://huggingface.co/datasets/meyabase/crowd-oshiwambo-speech-greetings"
|
23 |
REPOSITORY_DIR = "data"
|
24 |
LOCAL_DIR = 'data_local'
|
25 |
os.makedirs(LOCAL_DIR,exist_ok=True)
|
|
|
89 |
|
90 |
_ = upload_file(path_or_fileobj = audio_output_filename,
|
91 |
path_in_repo =repo_audio_path,
|
92 |
+
repo_id='meyabase/crowd-oshiwambo-speech-greetings',
|
93 |
repo_type='dataset',
|
94 |
token=HF_TOKEN
|
95 |
)
|
|
|
98 |
repo_json_path = os.path.join(REPOSITORY_DIR,os.path.join(audio_name,'metadata.jsonl'))
|
99 |
_ = upload_file(path_or_fileobj = json_file_path,
|
100 |
path_in_repo =repo_json_path,
|
101 |
+
repo_id='meyabase/crowd-oshiwambo-speech-greetings',
|
102 |
repo_type='dataset',
|
103 |
token=HF_TOKEN
|
104 |
)
|
|
|
166 |
repo_recordings = [os.path.join(REPOSITORY_DATA_DIR,f.name) for f in os.scandir(REPOSITORY_DATA_DIR)] if os.path.isdir(REPOSITORY_DATA_DIR) else []
|
167 |
|
168 |
audio_repo = [os.path.join(f,'audio.wav') for f in repo_recordings]
|
169 |
+
audio_repo = [a.replace('data/data/','https://huggingface.co/datasets/meyabase/crowd-oshiwambo-speech-greetings/resolve/main/data/') for a in audio_repo]
|
170 |
metadata_all = [get_metadata_json(os.path.join(f,'metadata.jsonl')) for f in repo_recordings]
|
171 |
metadata_all = [m for m in metadata_all if m!=[]]
|
172 |
return metadata_all
|
|
|
177 |
repo_recordings = [os.path.join(REPOSITORY_DATA_DIR,f.name) for f in os.scandir(REPOSITORY_DATA_DIR)] if os.path.isdir(REPOSITORY_DATA_DIR) else []
|
178 |
|
179 |
audio_repo = [os.path.join(f,'audio.wav') for f in repo_recordings]
|
180 |
+
audio_repo = [a.replace('data/data/','https://huggingface.co/datasets/meyabase/crowd-oshiwambo-speech-greetings/resolve/main/data/') for a in audio_repo]
|
181 |
metadata_repo = [read_json_lines(os.path.join(f,'metadata.jsonl'))[0] for f in repo_recordings]
|
182 |
audios_all = audio_repo
|
183 |
metadata_all = metadata_repo
|