Spaces:
Running
Running
update
Browse files- app.py +4 -7
- requirements.txt +0 -1
app.py
CHANGED
@@ -4,8 +4,6 @@ import random
|
|
4 |
import warnings
|
5 |
|
6 |
import gradio as gr
|
7 |
-
import librosa
|
8 |
-
import numpy as np
|
9 |
from datasets import IterableDatasetDict, load_dataset
|
10 |
from gradio_client import Client
|
11 |
from loguru import logger
|
@@ -13,7 +11,6 @@ from loguru import logger
|
|
13 |
warnings.filterwarnings("ignore")
|
14 |
|
15 |
NUM_TAR_FILES = 115
|
16 |
-
NUM_SAMPLES = 3746131
|
17 |
HF_PATH_TO_DATASET = "litagin/Galgame_Speech_SER_16kHz"
|
18 |
|
19 |
hf_token = os.getenv("HF_TOKEN")
|
@@ -214,7 +211,7 @@ with gr.Blocks(head=shortcut_js) as app:
|
|
214 |
logger.info("Putting unmodified")
|
215 |
current_key = data[key]
|
216 |
current_label_id = data[label_id]
|
217 |
-
|
218 |
new_data=json.dumps(
|
219 |
{
|
220 |
"key": current_key,
|
@@ -223,7 +220,7 @@ with gr.Blocks(head=shortcut_js) as app:
|
|
223 |
),
|
224 |
api_name="/put_data",
|
225 |
)
|
226 |
-
logger.info("Unmodified sent")
|
227 |
return set_next_item(data)
|
228 |
|
229 |
btn_init.click(
|
@@ -243,7 +240,7 @@ with gr.Blocks(head=shortcut_js) as app:
|
|
243 |
def put_label(data: dict, _id=_id) -> dict:
|
244 |
logger.info(f"Putting label: {id2rich_label[_id]}")
|
245 |
current_key = data[key]
|
246 |
-
|
247 |
new_data=json.dumps(
|
248 |
{
|
249 |
"key": current_key,
|
@@ -252,7 +249,7 @@ with gr.Blocks(head=shortcut_js) as app:
|
|
252 |
),
|
253 |
api_name="/put_data",
|
254 |
)
|
255 |
-
logger.info("Modified sent")
|
256 |
return set_next_item(data)
|
257 |
|
258 |
functions_list.append(put_label)
|
|
|
4 |
import warnings
|
5 |
|
6 |
import gradio as gr
|
|
|
|
|
7 |
from datasets import IterableDatasetDict, load_dataset
|
8 |
from gradio_client import Client
|
9 |
from loguru import logger
|
|
|
11 |
warnings.filterwarnings("ignore")
|
12 |
|
13 |
NUM_TAR_FILES = 115
|
|
|
14 |
HF_PATH_TO_DATASET = "litagin/Galgame_Speech_SER_16kHz"
|
15 |
|
16 |
hf_token = os.getenv("HF_TOKEN")
|
|
|
211 |
logger.info("Putting unmodified")
|
212 |
current_key = data[key]
|
213 |
current_label_id = data[label_id]
|
214 |
+
result = client.predict(
|
215 |
new_data=json.dumps(
|
216 |
{
|
217 |
"key": current_key,
|
|
|
220 |
),
|
221 |
api_name="/put_data",
|
222 |
)
|
223 |
+
logger.info(f"Unmodified sent, result: {result}")
|
224 |
return set_next_item(data)
|
225 |
|
226 |
btn_init.click(
|
|
|
240 |
def put_label(data: dict, _id=_id) -> dict:
|
241 |
logger.info(f"Putting label: {id2rich_label[_id]}")
|
242 |
current_key = data[key]
|
243 |
+
result = client.predict(
|
244 |
new_data=json.dumps(
|
245 |
{
|
246 |
"key": current_key,
|
|
|
249 |
),
|
250 |
api_name="/put_data",
|
251 |
)
|
252 |
+
logger.info(f"Modified sent, result: {result}")
|
253 |
return set_next_item(data)
|
254 |
|
255 |
functions_list.append(put_label)
|
requirements.txt
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
datasets
|
2 |
gradio==4.44.1
|
3 |
-
librosa
|
4 |
loguru
|
5 |
numpy<2.0
|
|
|
1 |
datasets
|
2 |
gradio==4.44.1
|
|
|
3 |
loguru
|
4 |
numpy<2.0
|