Spaces:
Sleeping
Sleeping
Yoon-gu Hwang
commited on
Commit
โข
ad8b121
1
Parent(s):
94bd001
fix bug
Browse files
app.py
CHANGED
@@ -22,7 +22,7 @@ with gr.Blocks() as demo:
|
|
22 |
with gr.Row():
|
23 |
todos = gr.DataFrame()
|
24 |
done = gr.DataFrame()
|
25 |
-
|
26 |
|
27 |
def csv2df(file):
|
28 |
df = pd.read_csv(file.name)
|
@@ -37,7 +37,7 @@ with gr.Blocks() as demo:
|
|
37 |
score = df_dict[state.value]['score']
|
38 |
gr.Info(f"์ด {len(dataset_df['df'])}๊ฐ ์ค์ {state.value + 1}๋ฒ์งธ ๋ฐ์ดํฐ์
๋๋ค.")
|
39 |
return [*update(), score]
|
40 |
-
|
41 |
def next_func(score):
|
42 |
df_dict = dataset_df['df_dict']
|
43 |
df_dict[state.value]['score'] = score
|
@@ -52,6 +52,7 @@ with gr.Blocks() as demo:
|
|
52 |
g = df_dict[state.value]['answer']
|
53 |
p = df_dict[state.value]['prediction']
|
54 |
df = pd.DataFrame(df_dict)
|
|
|
55 |
todos = df[df.score.isna()]
|
56 |
done = df[df.score.isna() == False]
|
57 |
return q, g, p, todos, done, "data_backup.csv"
|
|
|
22 |
with gr.Row():
|
23 |
todos = gr.DataFrame()
|
24 |
done = gr.DataFrame()
|
25 |
+
|
26 |
|
27 |
def csv2df(file):
|
28 |
df = pd.read_csv(file.name)
|
|
|
37 |
score = df_dict[state.value]['score']
|
38 |
gr.Info(f"์ด {len(dataset_df['df'])}๊ฐ ์ค์ {state.value + 1}๋ฒ์งธ ๋ฐ์ดํฐ์
๋๋ค.")
|
39 |
return [*update(), score]
|
40 |
+
|
41 |
def next_func(score):
|
42 |
df_dict = dataset_df['df_dict']
|
43 |
df_dict[state.value]['score'] = score
|
|
|
52 |
g = df_dict[state.value]['answer']
|
53 |
p = df_dict[state.value]['prediction']
|
54 |
df = pd.DataFrame(df_dict)
|
55 |
+
df.to_csv("data_backup.csv", index=False)
|
56 |
todos = df[df.score.isna()]
|
57 |
done = df[df.score.isna() == False]
|
58 |
return q, g, p, todos, done, "data_backup.csv"
|