Spaces:
Running
Running
Commit
β’
d6b712b
1
Parent(s):
7154e32
v0.9.1 (#20)
Browse files- Summary (c2c033aa0da7738f8c72080ddebb1cc1515b9e49)
Co-authored-by: Dmitry Ryumin <[email protected]>
- app/event_handlers/calculate_pt_scores_blocks.py +2 -2
- app/event_handlers/clear_blocks.py +1 -1
- app/event_handlers/event_handlers.py +2 -6
- app/event_handlers/files.py +6 -2
- app/event_handlers/languages.py +4 -2
- app/tabs.py +3 -1
- config.toml +1 -1
- requirements.txt +3 -3
app/event_handlers/calculate_pt_scores_blocks.py
CHANGED
@@ -54,7 +54,7 @@ def event_handler_calculate_pt_scores_blocks(language, files, evt_data: gr.Event
|
|
54 |
False,
|
55 |
"csv-container",
|
56 |
),
|
57 |
-
gr.HTML(value=STEP_2, visible=False),
|
58 |
gr.Column(visible=False),
|
59 |
radio_create_ui(
|
60 |
first_practical_task,
|
@@ -174,7 +174,7 @@ def event_handler_calculate_pt_scores_blocks(language, files, evt_data: gr.Event
|
|
174 |
True,
|
175 |
"csv-container",
|
176 |
),
|
177 |
-
gr.HTML(value=STEP_2, visible=True),
|
178 |
gr.Column(visible=True),
|
179 |
radio_create_ui(
|
180 |
first_practical_task,
|
|
|
54 |
False,
|
55 |
"csv-container",
|
56 |
),
|
57 |
+
gr.HTML(value=STEP_2[lang_id], visible=False),
|
58 |
gr.Column(visible=False),
|
59 |
radio_create_ui(
|
60 |
first_practical_task,
|
|
|
174 |
True,
|
175 |
"csv-container",
|
176 |
),
|
177 |
+
gr.HTML(value=STEP_2[lang_id], visible=True),
|
178 |
gr.Column(visible=True),
|
179 |
radio_create_ui(
|
180 |
first_practical_task,
|
app/event_handlers/clear_blocks.py
CHANGED
@@ -67,7 +67,7 @@ def event_handler_clear_blocks(language):
|
|
67 |
False,
|
68 |
"csv-container",
|
69 |
),
|
70 |
-
gr.HTML(value=STEP_2, visible=False),
|
71 |
gr.Column(visible=False),
|
72 |
radio_create_ui(
|
73 |
first_practical_task,
|
|
|
67 |
False,
|
68 |
"csv-container",
|
69 |
),
|
70 |
+
gr.HTML(value=STEP_2[lang_id], visible=False),
|
71 |
gr.Column(visible=False),
|
72 |
radio_create_ui(
|
73 |
first_practical_task,
|
app/event_handlers/event_handlers.py
CHANGED
@@ -101,7 +101,7 @@ def setup_app_event_handlers(
|
|
101 |
# Events
|
102 |
languages.select(
|
103 |
fn=event_handler_languages,
|
104 |
-
inputs=[languages, files, video],
|
105 |
outputs=[
|
106 |
description,
|
107 |
step_1,
|
@@ -122,11 +122,7 @@ def setup_app_event_handlers(
|
|
122 |
)
|
123 |
files.change(
|
124 |
event_handler_files,
|
125 |
-
[
|
126 |
-
languages,
|
127 |
-
files,
|
128 |
-
video,
|
129 |
-
],
|
130 |
[notifications, video, calculate_pt_scores, clear_app],
|
131 |
queue=True,
|
132 |
)
|
|
|
101 |
# Events
|
102 |
languages.select(
|
103 |
fn=event_handler_languages,
|
104 |
+
inputs=[languages, files, video, pt_scores],
|
105 |
outputs=[
|
106 |
description,
|
107 |
step_1,
|
|
|
122 |
)
|
123 |
files.change(
|
124 |
event_handler_files,
|
125 |
+
[languages, files, video, pt_scores],
|
|
|
|
|
|
|
|
|
126 |
[notifications, video, calculate_pt_scores, clear_app],
|
127 |
queue=True,
|
128 |
)
|
app/event_handlers/files.py
CHANGED
@@ -14,7 +14,7 @@ from app.components import html_message, video_create_ui, button
|
|
14 |
from app.utils import get_language_settings
|
15 |
|
16 |
|
17 |
-
def event_handler_files(language, files, video):
|
18 |
lang_id, _ = get_language_settings(language)
|
19 |
|
20 |
if not files:
|
@@ -43,7 +43,11 @@ def event_handler_files(language, files, video):
|
|
43 |
video = files[0]
|
44 |
|
45 |
return (
|
46 |
-
html_message(
|
|
|
|
|
|
|
|
|
47 |
video_create_ui(
|
48 |
value=video,
|
49 |
label=config_data.OtherMessages_VIDEO_PLAYER[lang_id],
|
|
|
14 |
from app.utils import get_language_settings
|
15 |
|
16 |
|
17 |
+
def event_handler_files(language, files, video, pt_scores):
|
18 |
lang_id, _ = get_language_settings(language)
|
19 |
|
20 |
if not files:
|
|
|
43 |
video = files[0]
|
44 |
|
45 |
return (
|
46 |
+
html_message(
|
47 |
+
config_data.OtherMessages_NOTI_CALCULATE[lang_id],
|
48 |
+
True,
|
49 |
+
False if pt_scores.shape[1] >= 7 else True,
|
50 |
+
),
|
51 |
video_create_ui(
|
52 |
value=video,
|
53 |
label=config_data.OtherMessages_VIDEO_PLAYER[lang_id],
|
app/event_handlers/languages.py
CHANGED
@@ -22,7 +22,7 @@ from app.components import (
|
|
22 |
from app.utils import get_language_settings
|
23 |
|
24 |
|
25 |
-
def event_handler_languages(languages, files, video):
|
26 |
lang_id, choices = get_language_settings(languages)
|
27 |
|
28 |
if not video:
|
@@ -37,7 +37,9 @@ def event_handler_languages(languages, files, video):
|
|
37 |
file_name=Path(video).name,
|
38 |
)
|
39 |
noti_videos = html_message(
|
40 |
-
config_data.OtherMessages_NOTI_CALCULATE[lang_id],
|
|
|
|
|
41 |
)
|
42 |
|
43 |
return (
|
|
|
22 |
from app.utils import get_language_settings
|
23 |
|
24 |
|
25 |
+
def event_handler_languages(languages, files, video, pt_scores):
|
26 |
lang_id, choices = get_language_settings(languages)
|
27 |
|
28 |
if not video:
|
|
|
37 |
file_name=Path(video).name,
|
38 |
)
|
39 |
noti_videos = html_message(
|
40 |
+
config_data.OtherMessages_NOTI_CALCULATE[lang_id],
|
41 |
+
True,
|
42 |
+
False if pt_scores.shape[1] >= 7 else True,
|
43 |
)
|
44 |
|
45 |
return (
|
app/tabs.py
CHANGED
@@ -102,7 +102,9 @@ def app_tab():
|
|
102 |
"csv-container",
|
103 |
)
|
104 |
|
105 |
-
step_2 = gr.HTML(
|
|
|
|
|
106 |
|
107 |
first_practical_task = next(iter(supported_practical_tasks))
|
108 |
|
|
|
102 |
"csv-container",
|
103 |
)
|
104 |
|
105 |
+
step_2 = gr.HTML(
|
106 |
+
value=STEP_2[config_data.AppSettings_DEFAULT_LANG_ID], visible=False
|
107 |
+
)
|
108 |
|
109 |
first_practical_task = next(iter(supported_practical_tasks))
|
110 |
|
config.toml
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
[AppSettings]
|
2 |
-
APP_VERSION = "0.9.
|
3 |
CSS_PATH = "app.css"
|
4 |
DEFAULT_LANG_ID = 0
|
5 |
|
|
|
1 |
[AppSettings]
|
2 |
+
APP_VERSION = "0.9.1"
|
3 |
CSS_PATH = "app.css"
|
4 |
DEFAULT_LANG_ID = 0
|
5 |
|
requirements.txt
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
gradio==4.40.0
|
2 |
-
requests==2.
|
3 |
PyYAML==6.0.1
|
4 |
toml==0.10.2
|
5 |
-
oceanai==1.0.
|
6 |
tf-keras==2.16.0
|
7 |
-
pandas==2.2.
|
|
|
1 |
gradio==4.40.0
|
2 |
+
requests==2.32.3
|
3 |
PyYAML==6.0.1
|
4 |
toml==0.10.2
|
5 |
+
oceanai==1.0.0a30
|
6 |
tf-keras==2.16.0
|
7 |
+
pandas==2.2.2
|