Spaces:
Running
v0.10.8 (#30)
Browse files- Summary (f6125144e9df803bac37023b6854f03c30d62a31)
- Merge branch 'main' of https://huggingface.co/spaces/ElenaRyumina/OCEANAI (2f050c06a94348ba17660fdf0dd257a7a30f2f9a)
- Summary (8f52d543a1de5a77b59164e6f4f721696fc64299)
- Merge branch 'main' of https://huggingface.co/spaces/ElenaRyumina/OCEANAI (fffa0062f0da04563ce8cd5b8c7e70e3ae783833)
- Summary (1717e06c53138f3eaf52e38f984035d5fbbceac5)
- Merge branch 'main' of https://huggingface.co/spaces/ElenaRyumina/OCEANAI (cd90a1620005039e6998ca3d0ab34fe3bfe1f2dc)
- Summary (98c66eeb6760ebd60d0a4ae4d9d0ac8f896a59df)
- Update config.toml (91d9d7ef4e540930919833c79607c51fc294d60d)
- Merge branch 'main' of https://huggingface.co/spaces/ElenaRyumina/OCEANAI (e6358979bef7df974cdd6c63aca029c57ac62af8)
- Summary (6de61f5802c0e3640047369ad08ecab73b331d34)
- Update config.toml (b5ed9ffe1ad1d0f500f794adbdaf154836c4f98b)
- Summary (32a92bfceec53fd471bc976cbb849fd9d927ad83)
- Merge branch 'main' of https://huggingface.co/spaces/ElenaRyumina/OCEANAI (da47ac2a7b54d4ff7a69c19e9a2c785464ca5016)
- Merge branch 'main' of https://huggingface.co/spaces/ElenaRyumina/OCEANAI (a38174b5323e173d29898a3d3914e1fff4956b23)
- Summary (fe195552c3857fb5eb2edd95cb44bc2702b5d340)
- Merge branch 'main' of https://huggingface.co/spaces/ElenaRyumina/OCEANAI (1c886618681448e721a7e6daec1c567743446d5d)
- Summary (d02f294f9243051ee718760d8a7206211a67c88e)
Co-authored-by: Dmitry Ryumin <[email protected]>
- app.py +4 -4
- app/event_handlers/calculate_practical_tasks.py +33 -5
- app/event_handlers/practical_subtasks.py +6 -6
- config.toml +1 -1
- practical_tasks_en.yaml +1 -1
|
@@ -91,8 +91,8 @@ if __name__ == "__main__":
|
|
| 91 |
if is_port_in_use(config_data.AppSettings_SERVER_NAME, port):
|
| 92 |
free_ports(port)
|
| 93 |
|
| 94 |
-
create_gradio_app().queue(api_open=
|
| 95 |
-
share=
|
| 96 |
-
server_name=
|
| 97 |
-
server_port=
|
| 98 |
)
|
|
|
|
| 91 |
if is_port_in_use(config_data.AppSettings_SERVER_NAME, port):
|
| 92 |
free_ports(port)
|
| 93 |
|
| 94 |
+
create_gradio_app().queue(api_open=False).launch(
|
| 95 |
+
share=False,
|
| 96 |
+
server_name=config_data.AppSettings_SERVER_NAME,
|
| 97 |
+
server_port=config_data.AppSettings_PORT,
|
| 98 |
)
|
|
@@ -733,7 +733,7 @@ def event_handler_calculate_practical_task_blocks(
|
|
| 733 |
elif (
|
| 734 |
practical_subtasks.lower() == "car characteristics"
|
| 735 |
or practical_subtasks.lower() == "mobile device application categories"
|
| 736 |
-
or practical_subtasks.lower() == "clothing
|
| 737 |
):
|
| 738 |
if practical_subtasks.lower() == "car characteristics":
|
| 739 |
df_correlation_coefficients = read_csv_file(
|
|
@@ -744,9 +744,13 @@ def event_handler_calculate_practical_task_blocks(
|
|
| 744 |
df_correlation_coefficients = read_csv_file(
|
| 745 |
config_data.Links_MDA_CATEGORIES
|
| 746 |
)
|
| 747 |
-
elif practical_subtasks.lower() == "clothing
|
| 748 |
df_correlation_coefficients = read_csv_file(config_data.Links_CLOTHING_SC)
|
| 749 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 750 |
pt_scores_copy = pt_scores.iloc[:, 1:].copy()
|
| 751 |
|
| 752 |
preprocess_scores_df(pt_scores_copy, config_data.Dataframes_PT_SCORES[0][0])
|
|
@@ -768,13 +772,37 @@ def event_handler_calculate_practical_task_blocks(
|
|
| 768 |
|
| 769 |
preprocess_scores_df(df, config_data.Dataframes_PT_SCORES[0][0])
|
| 770 |
|
| 771 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 772 |
|
| 773 |
df_hidden.to_csv(consumer_preferences(practical_subtasks))
|
| 774 |
|
| 775 |
-
df_hidden.reset_index(
|
|
|
|
|
|
|
|
|
|
| 776 |
|
| 777 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 778 |
|
| 779 |
person_metadata = create_person_metadata(person_id, files, video_metadata)
|
| 780 |
|
|
|
|
| 733 |
elif (
|
| 734 |
practical_subtasks.lower() == "car characteristics"
|
| 735 |
or practical_subtasks.lower() == "mobile device application categories"
|
| 736 |
+
or practical_subtasks.lower() == "clothing styles"
|
| 737 |
):
|
| 738 |
if practical_subtasks.lower() == "car characteristics":
|
| 739 |
df_correlation_coefficients = read_csv_file(
|
|
|
|
| 744 |
df_correlation_coefficients = read_csv_file(
|
| 745 |
config_data.Links_MDA_CATEGORIES
|
| 746 |
)
|
| 747 |
+
elif practical_subtasks.lower() == "clothing styles":
|
| 748 |
df_correlation_coefficients = read_csv_file(config_data.Links_CLOTHING_SC)
|
| 749 |
|
| 750 |
+
if type_modes == config_data.Settings_TYPE_MODES[1]:
|
| 751 |
+
number_priority = df_correlation_coefficients.columns.size - 1
|
| 752 |
+
number_importance_traits = 5
|
| 753 |
+
|
| 754 |
pt_scores_copy = pt_scores.iloc[:, 1:].copy()
|
| 755 |
|
| 756 |
preprocess_scores_df(pt_scores_copy, config_data.Dataframes_PT_SCORES[0][0])
|
|
|
|
| 772 |
|
| 773 |
preprocess_scores_df(df, config_data.Dataframes_PT_SCORES[0][0])
|
| 774 |
|
| 775 |
+
if type_modes == config_data.Settings_TYPE_MODES[0]:
|
| 776 |
+
del_cols = []
|
| 777 |
+
elif type_modes == config_data.Settings_TYPE_MODES[1]:
|
| 778 |
+
del_cols = config_data.Settings_DROPDOWN_MBTI_DEL_COLS_WEBCAM
|
| 779 |
+
|
| 780 |
+
df_hidden = df.drop(
|
| 781 |
+
columns=config_data.Settings_SHORT_PROFESSIONAL_SKILLS + del_cols
|
| 782 |
+
)
|
| 783 |
+
|
| 784 |
+
if type_modes == config_data.Settings_TYPE_MODES[1]:
|
| 785 |
+
df_hidden = df_hidden.T
|
| 786 |
+
|
| 787 |
+
df_hidden = df_hidden.head(-number_importance_traits)
|
| 788 |
+
|
| 789 |
+
df_hidden = df_hidden.reset_index()
|
| 790 |
+
|
| 791 |
+
df_hidden.columns = ["Category", "Priority"]
|
| 792 |
|
| 793 |
df_hidden.to_csv(consumer_preferences(practical_subtasks))
|
| 794 |
|
| 795 |
+
df_hidden.reset_index(
|
| 796 |
+
drop=True if type_modes == config_data.Settings_TYPE_MODES[1] else False,
|
| 797 |
+
inplace=True,
|
| 798 |
+
)
|
| 799 |
|
| 800 |
+
if type_modes == config_data.Settings_TYPE_MODES[0]:
|
| 801 |
+
person_id = (
|
| 802 |
+
int(df_hidden.iloc[0][config_data.Dataframes_PT_SCORES[0][0]]) - 1
|
| 803 |
+
)
|
| 804 |
+
elif type_modes == config_data.Settings_TYPE_MODES[1]:
|
| 805 |
+
person_id = 0
|
| 806 |
|
| 807 |
person_metadata = create_person_metadata(person_id, files, video_metadata)
|
| 808 |
|
|
@@ -318,7 +318,7 @@ def event_handler_practical_subtasks(
|
|
| 318 |
elif (
|
| 319 |
practical_subtasks.lower() == "car characteristics"
|
| 320 |
or practical_subtasks.lower() == "mobile device application categories"
|
| 321 |
-
or practical_subtasks.lower() == "clothing
|
| 322 |
):
|
| 323 |
if practical_subtasks.lower() == "car characteristics":
|
| 324 |
|
|
@@ -333,12 +333,12 @@ def event_handler_practical_subtasks(
|
|
| 333 |
config_data.Links_MDA_CATEGORIES
|
| 334 |
)
|
| 335 |
|
| 336 |
-
elif practical_subtasks.lower() == "clothing
|
| 337 |
df_correlation_coefficients = read_csv_file(config_data.Links_CLOTHING_SC)
|
| 338 |
|
| 339 |
return (
|
| 340 |
practical_subtasks_selected,
|
| 341 |
-
gr.Column(visible=
|
| 342 |
dropdown_create_ui(visible=False),
|
| 343 |
number_create_ui(visible=False),
|
| 344 |
number_create_ui(visible=False),
|
|
@@ -369,7 +369,7 @@ def event_handler_practical_subtasks(
|
|
| 369 |
),
|
| 370 |
show_label=True,
|
| 371 |
interactive=True,
|
| 372 |
-
visible=
|
| 373 |
render=True,
|
| 374 |
elem_classes="number-container",
|
| 375 |
),
|
|
@@ -382,7 +382,7 @@ def event_handler_practical_subtasks(
|
|
| 382 |
info=config_data.InformationMessages_VALUE_FROM_TO_INFO.format(1, 5),
|
| 383 |
show_label=True,
|
| 384 |
interactive=True,
|
| 385 |
-
visible=
|
| 386 |
render=True,
|
| 387 |
elem_classes="number-container",
|
| 388 |
),
|
|
@@ -395,7 +395,7 @@ def event_handler_practical_subtasks(
|
|
| 395 |
info=config_data.InformationMessages_VALUE_FROM_TO_INFO.format(0, 1.0),
|
| 396 |
show_label=True,
|
| 397 |
interactive=True,
|
| 398 |
-
visible=
|
| 399 |
render=True,
|
| 400 |
elem_classes="number-container",
|
| 401 |
),
|
|
|
|
| 318 |
elif (
|
| 319 |
practical_subtasks.lower() == "car characteristics"
|
| 320 |
or practical_subtasks.lower() == "mobile device application categories"
|
| 321 |
+
or practical_subtasks.lower() == "clothing styles"
|
| 322 |
):
|
| 323 |
if practical_subtasks.lower() == "car characteristics":
|
| 324 |
|
|
|
|
| 333 |
config_data.Links_MDA_CATEGORIES
|
| 334 |
)
|
| 335 |
|
| 336 |
+
elif practical_subtasks.lower() == "clothing styles":
|
| 337 |
df_correlation_coefficients = read_csv_file(config_data.Links_CLOTHING_SC)
|
| 338 |
|
| 339 |
return (
|
| 340 |
practical_subtasks_selected,
|
| 341 |
+
gr.Column(visible=visible_subtasks),
|
| 342 |
dropdown_create_ui(visible=False),
|
| 343 |
number_create_ui(visible=False),
|
| 344 |
number_create_ui(visible=False),
|
|
|
|
| 369 |
),
|
| 370 |
show_label=True,
|
| 371 |
interactive=True,
|
| 372 |
+
visible=visible_subtasks,
|
| 373 |
render=True,
|
| 374 |
elem_classes="number-container",
|
| 375 |
),
|
|
|
|
| 382 |
info=config_data.InformationMessages_VALUE_FROM_TO_INFO.format(1, 5),
|
| 383 |
show_label=True,
|
| 384 |
interactive=True,
|
| 385 |
+
visible=visible_subtasks,
|
| 386 |
render=True,
|
| 387 |
elem_classes="number-container",
|
| 388 |
),
|
|
|
|
| 395 |
info=config_data.InformationMessages_VALUE_FROM_TO_INFO.format(0, 1.0),
|
| 396 |
show_label=True,
|
| 397 |
interactive=True,
|
| 398 |
+
visible=visible_subtasks,
|
| 399 |
render=True,
|
| 400 |
elem_classes="number-container",
|
| 401 |
),
|
|
@@ -1,5 +1,5 @@
|
|
| 1 |
[AppSettings]
|
| 2 |
-
APP_VERSION = "0.10.
|
| 3 |
SERVER_NAME = "127.0.0.1"
|
| 4 |
PORT = 7860
|
| 5 |
CSS_PATH = "app.css"
|
|
|
|
| 1 |
[AppSettings]
|
| 2 |
+
APP_VERSION = "0.10.8"
|
| 3 |
SERVER_NAME = "127.0.0.1"
|
| 4 |
PORT = 7860
|
| 5 |
CSS_PATH = "app.css"
|
|
@@ -11,4 +11,4 @@
|
|
| 11 |
subtasks:
|
| 12 |
- "Car characteristics"
|
| 13 |
- "Mobile device application categories"
|
| 14 |
-
- "Clothing
|
|
|
|
| 11 |
subtasks:
|
| 12 |
- "Car characteristics"
|
| 13 |
- "Mobile device application categories"
|
| 14 |
+
- "Clothing styles"
|