Sangwon78 commited on
Commit
8dece66
ยท
verified ยท
1 Parent(s): 3d45892

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +69 -187
app.py CHANGED
@@ -1,202 +1,84 @@
 
1
  import os
2
- import tempfile
3
  import pandas as pd
4
  import gradio as gr
5
- # ๋งŒ์•ฝ OPENAI API๋ฅผ ์ง์ ‘ ์‚ฌ์šฉํ•ด์•ผ ํ•  ๊ฒฝ์šฐ:
6
- # import openai
7
- # openai.api_key = os.getenv("OPENAI_API_KEY")
8
 
9
- ###################################
10
- # ๋ฐ์ดํ„ฐ ์ฒ˜๋ฆฌ ํ•จ์ˆ˜๋“ค
11
- ###################################
12
-
13
- def process_upload(file):
14
- """
15
- 1) ์—…๋กœ๋“œ๋œ ์—‘์…€ ํŒŒ์ผ์—์„œ A~F์—ด(๋ฆฌ๋ทฐ๋‚ด์šฉ ํฌํ•จ)์„ ์ฝ์–ด์˜ด
16
- 2) ์ถœ๋ ฅํ™”๋ฉด(2๊ฐœ)์—๋Š” ์›๋ณธ ๋ฐ์ดํ„ฐ๋ฅผ ๋ณด์—ฌ์คŒ
17
- 3) ์•„์ง ๋‹ค์šด๋กœ๋“œ ํŒŒ์ผ์€ ์ƒ์„ฑํ•˜์ง€ ์•Š๊ณ , state(์›๋ณธ df)๋งŒ ๋ฐ˜ํ™˜
18
- """
19
- if file is None:
20
- # ์ถœ๋ ฅํ™”๋ฉด 2๊ฐœ + ๋‚ ์งœ์ •๋ ฌ ๋‹ค์šด๋กœ๋“œ 2๊ฐœ + ์ ์ˆ˜์ •๋ ฌ ๋‹ค์šด๋กœ๋“œ 2๊ฐœ + ์›๋ณธ ๋‹ค์šด๋กœ๋“œ 2๊ฐœ + state = ์ด 9๊ฐœ
21
- return None, None, None, None, None, None, None, None, None
22
-
23
- # A~F ์—ด๋งŒ ์„ ํƒ
24
  df = pd.read_excel(file.name)
25
- df = df.iloc[:, :6]
26
-
27
- # ์•„์ง ๋‹ค์šด๋กœ๋“œ ํŒŒ์ผ์€ ๋งŒ๋“ค์ง€ ์•Š์Œ -> ์ „๋ถ€ None
28
- # ์ถœ๋ ฅํ™”๋ฉด 1,2 ์—๋Š” df ํ‘œ์‹œ, state ๋กœ df ๋ณด๊ด€
29
- return df, df, None, None, None, None, None, None, df
30
-
31
- def sort_by_date(df):
32
- """
33
- ๋ฆฌ๋ทฐ๋‚ ์งœ ๊ธฐ์ค€ ์ •๋ ฌ:
34
- - ์ถœ๋ ฅํ™”๋ฉด1: ์ตœ์‹  ๋‚ ์งœ(๋‚ด๋ฆผ์ฐจ์ˆœ)
35
- - ์ถœ๋ ฅํ™”๋ฉด2: ์˜ค๋ž˜๋œ ๋‚ ์งœ(์˜ค๋ฆ„์ฐจ์ˆœ)
36
- - ๋‚ ์งœ์ •๋ ฌ ๋‹ค์šด๋กœ๋“œ ํŒŒ์ผ 2๊ฐœ ์ƒ์„ฑ
37
- - ๋‹ค๋ฅธ ๋‹ค์šด๋กœ๋“œ(์ ์ˆ˜์ •๋ ฌ, ์›๋ณธ)๋Š” None ์ฒ˜๋ฆฌ
38
- """
39
- if df is None:
40
- return None, None, None, None, None, None, None, None, None
41
-
42
- # '๋ฆฌ๋ทฐ๋‚ ์งœ'๋ฅผ datetime์œผ๋กœ ๋ณ€ํ™˜
43
- df['๋ฆฌ๋ทฐ๋‚ ์งœ'] = pd.to_datetime(df['๋ฆฌ๋ทฐ๋‚ ์งœ'], errors='coerce')
44
- df_new = df.sort_values(by='๋ฆฌ๋ทฐ๋‚ ์งœ', ascending=False)
45
- df_old = df.sort_values(by='๋ฆฌ๋ทฐ๋‚ ์งœ', ascending=True)
46
-
47
- # ๋‚ ์งœ์ •๋ ฌ ๊ฒฐ๊ณผ๋ฅผ ๊ฐ๊ฐ ์—‘์…€ ํŒŒ์ผ๋กœ ์ €์žฅ
48
- temp_file1 = tempfile.NamedTemporaryFile(delete=False, suffix=".xlsx")
49
- temp_file2 = tempfile.NamedTemporaryFile(delete=False, suffix=".xlsx")
50
- with pd.ExcelWriter(temp_file1.name, engine='openpyxl') as writer:
51
- df_new.to_excel(writer, index=False)
52
- with pd.ExcelWriter(temp_file2.name, engine='openpyxl') as writer:
53
- df_old.to_excel(writer, index=False)
54
-
55
- # ์ถœ๋ ฅ ์ˆœ์„œ:
56
- # (์ถœ๋ ฅํ™”๋ฉด1, ์ถœ๋ ฅํ™”๋ฉด2, ๋‚ ์งœ๋‹ค์šด1, ๋‚ ์งœ๋‹ค์šด2, ์ ์ˆ˜๋‹ค์šด1, ์ ์ˆ˜๋‹ค์šด2, ์›๋ณธ๋‹ค์šด1, ์›๋ณธ๋‹ค์šด2, state)
57
- return df_new, df_old, temp_file1.name, temp_file2.name, None, None, None, None, df
58
-
59
- def sort_by_score(df):
60
- """
61
- ๋ฆฌ๋ทฐ์ ์ˆ˜ ๊ธฐ์ค€ ์ •๋ ฌ:
62
- - ์ถœ๋ ฅํ™”๋ฉด1: ๋†’์€ ์ ์ˆ˜(๋‚ด๋ฆผ์ฐจ์ˆœ)
63
- - ์ถœ๋ ฅํ™”๋ฉด2: ๋‚ฎ์€ ์ ์ˆ˜(์˜ค๋ฆ„์ฐจ์ˆœ)
64
- - ์ ์ˆ˜์ •๋ ฌ ๋‹ค์šด๋กœ๋“œ ํŒŒ์ผ 2๊ฐœ ์ƒ์„ฑ
65
- - ๋‹ค๋ฅธ ๋‹ค์šด๋กœ๋“œ(๋‚ ์งœ์ •๋ ฌ, ์›๋ณธ)๋Š” None ์ฒ˜๋ฆฌ
66
- """
67
- if df is None:
68
- return None, None, None, None, None, None, None, None, None
69
-
70
- df_high = df.sort_values(by='๋ฆฌ๋ทฐ์ ์ˆ˜', ascending=False)
71
- df_low = df.sort_values(by='๋ฆฌ๋ทฐ์ ์ˆ˜', ascending=True)
72
-
73
- # ์ ์ˆ˜์ •๋ ฌ ๊ฒฐ๊ณผ๋ฅผ ๊ฐ๊ฐ ์—‘์…€ ํŒŒ์ผ๋กœ ์ €์žฅ
74
- temp_file1 = tempfile.NamedTemporaryFile(delete=False, suffix=".xlsx")
75
- temp_file2 = tempfile.NamedTemporaryFile(delete=False, suffix=".xlsx")
76
- with pd.ExcelWriter(temp_file1.name, engine='openpyxl') as writer:
77
- df_high.to_excel(writer, index=False)
78
- with pd.ExcelWriter(temp_file2.name, engine='openpyxl') as writer:
79
- df_low.to_excel(writer, index=False)
80
-
81
- # ์ถœ๋ ฅ ์ˆœ์„œ:
82
- # (์ถœ๋ ฅํ™”๋ฉด1, ์ถœ๋ ฅํ™”๋ฉด2, ๋‚ ์งœ๋‹ค์šด1, ๋‚ ์งœ๋‹ค์šด2, ์ ์ˆ˜๋‹ค์šด1, ์ ์ˆ˜๋‹ค์šด2, ์›๋ณธ๋‹ค์šด1, ์›๋ณธ๋‹ค์šด2, state)
83
- return df_high, df_low, None, None, temp_file1.name, temp_file2.name, None, None, df
84
-
85
- def reset_data(df):
86
- """
87
- ์›๋ณธ ๋ฐ์ดํ„ฐ๋ฅผ ๊ทธ๋Œ€๋กœ ๋‘ ํ™”๋ฉด์— ํ‘œ์‹œ.
88
- - ์›๋ณธ ๋‹ค์šด๋กœ๋“œ ํŒŒ์ผ 2๊ฐœ ์ƒ์„ฑ
89
- - ๋‚ ์งœ/์ ์ˆ˜์ •๋ ฌ ๋‹ค์šด๋กœ๋“œ๋Š” None ์ฒ˜๋ฆฌ
90
- """
91
- if df is None:
92
- return None, None, None, None, None, None, None, None, None
93
-
94
- temp_file1 = tempfile.NamedTemporaryFile(delete=False, suffix=".xlsx")
95
- temp_file2 = tempfile.NamedTemporaryFile(delete=False, suffix=".xlsx")
96
- with pd.ExcelWriter(temp_file1.name, engine='openpyxl') as writer:
97
- df.to_excel(writer, index=False)
98
- with pd.ExcelWriter(temp_file2.name, engine='openpyxl') as writer:
99
- df.to_excel(writer, index=False)
100
 
101
- # ์ถœ๋ ฅ ์ˆœ์„œ:
102
- # (์ถœ๋ ฅํ™”๋ฉด1, ์ถœ๋ ฅํ™”๋ฉด2, ๋‚ ์งœ๋‹ค์šด1, ๋‚ ์งœ๋‹ค์šด2, ์ ์ˆ˜๋‹ค์šด1, ์ ์ˆ˜๋‹ค์šด2, ์›๋ณธ๋‹ค์šด1, ์›๋ณธ๋‹ค์šด2, state)
103
- return df, df, None, None, None, None, temp_file1.name, temp_file2.name, df
 
 
 
 
104
 
105
- ###################################
106
  # Gradio ์ธํ„ฐํŽ˜์ด์Šค ๊ตฌ์„ฑ
107
- ###################################
108
-
109
  with gr.Blocks(title="์—‘์…€๋ถ„์„๊ธฐ") as demo:
110
- gr.Markdown("""
111
- # ์—‘์…€๋ถ„์„๊ธฐ
112
- ์—‘์…€ ํŒŒ์ผ(A~F์—ด, D์—ด์€ ๋ฆฌ๋ทฐ๋‚ด์šฉ ํฌํ•จ)์„ ์—…๋กœ๋“œํ•˜๊ณ ,
113
- **๋ฆฌ๋ทฐ๋‚ ์งœ**, **๋ฆฌ๋ทฐ์ ์ˆ˜**, **์›๋ณธ๋ณด๊ธฐ** ๋ฒ„ํŠผ์œผ๋กœ ์ •๋ ฌ ๊ฒฐ๊ณผ๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
114
- ๊ฐ ์ •๋ ฌ ๊ฒฐ๊ณผ๋ณ„๋กœ **์—‘์…€ ํŒŒ์ผ ๋‹ค์šด๋กœ๋“œ**๊ฐ€ ๋ถ„๋ฆฌ๋˜์–ด ์žˆ์–ด, ์ถฉ๋Œ ์—†์ด ๋‹ค์šด๋กœ๋“œ๊ฐ€ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.
115
- """)
116
-
117
- with gr.Row():
118
- file_input = gr.File(label="์—‘์…€ํŒŒ์ผ ์—…๋กœ๋“œ", file_types=['.xlsx', '.xls'])
119
 
120
- # ์›๋ณธ ๋ฐ์ดํ„ฐ(state) ๋ณด๊ด€์šฉ
121
- state = gr.State()
122
-
123
- # ์ถœ๋ ฅํ™”๋ฉด 2๊ฐœ
124
  with gr.Row():
125
- output1 = gr.Dataframe(label="์ถœ๋ ฅํ™”๋ฉด 1", max_rows=15)
126
- output2 = gr.Dataframe(label="์ถœ๋ ฅํ™”๋ฉด 2", max_rows=15)
127
-
128
- # ๋‚ ์งœ์ •๋ ฌ ๋‹ค์šด๋กœ๋“œ 2๊ฐœ
129
- with gr.Row():
130
- date_file_output1 = gr.File(label="(๋‚ ์งœ์ •๋ ฌ) ๋‹ค์šด๋กœ๋“œ ํŒŒ์ผ1")
131
- date_file_output2 = gr.File(label="(๋‚ ์งœ์ •๋ ฌ) ๋‹ค์šด๋กœ๋“œ ํŒŒ์ผ2")
132
-
133
- # ์ ์ˆ˜์ •๋ ฌ ๋‹ค์šด๋กœ๋“œ 2๊ฐœ
134
  with gr.Row():
135
- score_file_output1 = gr.File(label="(์ ์ˆ˜์ •๋ ฌ) ๋‹ค์šด๋กœ๋“œ ํŒŒ์ผ1")
136
- score_file_output2 = gr.File(label="(์ ์ˆ˜์ •๋ ฌ) ๋‹ค์šด๋กœ๋“œ ํŒŒ์ผ2")
137
-
138
- # ์›๋ณธ๋ณด๊ธฐ ๋‹ค์šด๋กœ๋“œ 2๊ฐœ
139
  with gr.Row():
140
- reset_file_output1 = gr.File(label="(์›๋ณธ) ๋‹ค์šด๋กœ๋“œ ํŒŒ์ผ1")
141
- reset_file_output2 = gr.File(label="(์›๋ณธ) ๋‹ค์šด๋กœ๋“œ ํŒŒ์ผ2")
142
-
143
  with gr.Row():
144
- btn_date = gr.Button("๋ฆฌ๋ทฐ๋‚ ์งœ")
145
- btn_score = gr.Button("๋ฆฌ๋ทฐ์ ์ˆ˜")
146
- btn_reset = gr.Button("์›๋ณธ๋ณด๊ธฐ")
147
-
148
- # ํŒŒ์ผ ์—…๋กœ๋“œ -> process_upload
149
- # outputs 9๊ฐœ: (์ถœ๋ ฅ1, ์ถœ๋ ฅ2, ๋‚ ์งœ๋‹ค์šด1, ๋‚ ์งœ๋‹ค์šด2, ์ ์ˆ˜๋‹ค์šด1, ์ ์ˆ˜๋‹ค์šด2, ์›๋ณธ๋‹ค์šด1, ์›๋ณธ๋‹ค์šด2, state)
150
- file_input.change(
151
- fn=process_upload,
152
- inputs=file_input,
153
- outputs=[
154
- output1, output2,
155
- date_file_output1, date_file_output2,
156
- score_file_output1, score_file_output2,
157
- reset_file_output1, reset_file_output2,
158
- state
159
- ]
160
- )
161
-
162
- # ๋ฆฌ๋ทฐ๋‚ ์งœ ๋ฒ„ํŠผ -> sort_by_date
163
- btn_date.click(
164
- fn=sort_by_date,
165
- inputs=state,
166
- outputs=[
167
- output1, output2,
168
- date_file_output1, date_file_output2,
169
- score_file_output1, score_file_output2,
170
- reset_file_output1, reset_file_output2,
171
- state
172
- ]
173
- )
174
-
175
- # ๋ฆฌ๋ทฐ์ ์ˆ˜ ๋ฒ„ํŠผ -> sort_by_score
176
- btn_score.click(
177
- fn=sort_by_score,
178
- inputs=state,
179
- outputs=[
180
- output1, output2,
181
- date_file_output1, date_file_output2,
182
- score_file_output1, score_file_output2,
183
- reset_file_output1, reset_file_output2,
184
- state
185
- ]
186
- )
187
-
188
- # ์›๋ณธ๋ณด๊ธฐ ๋ฒ„ํŠผ -> reset_data
189
- btn_reset.click(
190
- fn=reset_data,
191
- inputs=state,
192
- outputs=[
193
- output1, output2,
194
- date_file_output1, date_file_output2,
195
- score_file_output1, score_file_output2,
196
- reset_file_output1, reset_file_output2,
197
- state
198
- ]
199
- )
200
 
201
- # ์•ฑ ์‹คํ–‰
202
- demo.launch()
 
1
+ # app.py
2
  import os
 
3
  import pandas as pd
4
  import gradio as gr
 
 
 
5
 
6
+ # ์—‘์…€ ํŒŒ์ผ์„ ์ฝ์–ด 4๊ฐ€์ง€ ์ •๋ ฌ ๊ฒฐ๊ณผ์™€ ํ•ด๋‹น CSV ํŒŒ์ผ ๊ฒฝ๋กœ๋ฅผ ๋ฐ˜ํ™˜ํ•˜๋Š” ํ•จ์ˆ˜
7
+ def process_file(file):
8
+ # ์—‘์…€ ํŒŒ์ผ ์ฝ๊ธฐ (์ฒซ 6๊ฐœ ์—ด๋งŒ ์„ ํƒ)
 
 
 
 
 
 
 
 
 
 
 
 
9
  df = pd.read_excel(file.name)
10
+ df = df.iloc[:, :6] # A~F ์—ด๋งŒ ์‚ฌ์šฉ
11
+
12
+ # ๋ฆฌ๋ทฐ๋‚ ์งœ ๊ธฐ์ค€ ์ •๋ ฌ (๋‚ ์งœํ˜•์œผ๋กœ ๋ณ€ํ™˜, ๋ณ€ํ™˜ ์‹คํŒจ์‹œ NaT)
13
+ try:
14
+ df['๋ฆฌ๋ทฐ๋‚ ์งœ'] = pd.to_datetime(df['๋ฆฌ๋ทฐ๋‚ ์งœ'], errors='coerce')
15
+ except Exception as e:
16
+ print("๋ฆฌ๋ทฐ๋‚ ์งœ ๋ณ€ํ™˜ ์—๋Ÿฌ:", e)
17
+ date_recent = df.sort_values(by='๋ฆฌ๋ทฐ๋‚ ์งœ', ascending=False)
18
+ date_old = df.sort_values(by='๋ฆฌ๋ทฐ๋‚ ์งœ', ascending=True)
19
+
20
+ # ๋ฆฌ๋ทฐ์ ์ˆ˜ ๊ธฐ์ค€ ์ •๋ ฌ (์ˆซ์žํ˜•์œผ๋กœ ๋ณ€ํ™˜)
21
+ try:
22
+ df['๋ฆฌ๋ทฐ์ ์ˆ˜'] = pd.to_numeric(df['๋ฆฌ๋ทฐ์ ์ˆ˜'], errors='coerce')
23
+ except Exception as e:
24
+ print("๋ฆฌ๋ทฐ์ ์ˆ˜ ๋ณ€ํ™˜ ์—๋Ÿฌ:", e)
25
+ score_high = df.sort_values(by='๋ฆฌ๋ทฐ์ ์ˆ˜', ascending=False)
26
+ score_low = df.sort_values(by='๋ฆฌ๋ทฐ์ ์ˆ˜', ascending=True)
27
+
28
+ # CSV ํŒŒ์ผ๋กœ ์ €์žฅ (ํ˜„์žฌ ์ž‘์—… ๋””๋ ‰ํ† ๋ฆฌ์— ์ €์žฅ๋จ)
29
+ date_recent_file = "date_recent.csv"
30
+ date_old_file = "date_old.csv"
31
+ score_high_file = "score_high.csv"
32
+ score_low_file = "score_low.csv"
33
+ date_recent.to_csv(date_recent_file, index=False)
34
+ date_old.to_csv(date_old_file, index=False)
35
+ score_high.to_csv(score_high_file, index=False)
36
+ score_low.to_csv(score_low_file, index=False)
37
+
38
+ return date_recent, date_old, score_high, score_low, date_recent_file, date_old_file, score_high_file, score_low_file
39
+
40
+ # ๋ฆฌ๋ทฐ๋‚ ์งœ ๋ฒ„ํŠผ ํด๋ฆญ ์‹œ ์‹คํ–‰๋˜๋Š” ํ•จ์ˆ˜
41
+ def on_date(file):
42
+ if file is None:
43
+ return [None] * 6
44
+ date_recent, date_old, score_high, score_low, date_recent_file, date_old_file, score_high_file, score_low_file = process_file(file)
45
+ # ์ฒซ๋ฒˆ์งธ ํ™”๋ฉด: ๋ฆฌ๋ทฐ๋‚ ์งœ ๋‚ด๋ฆผ์ฐจ์ˆœ, ๋‘๋ฒˆ์งธ ํ™”๋ฉด: ๋ฆฌ๋ทฐ๋‚ ์งœ ์˜ค๋ฆ„์ฐจ์ˆœ
46
+ return date_recent, date_old, date_recent_file, date_old_file, score_high_file, score_low_file
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
 
48
+ # ๋ฆฌ๋ทฐ์ ์ˆ˜ ๋ฒ„ํŠผ ํด๋ฆญ ์‹œ ์‹คํ–‰๋˜๋Š” ํ•จ์ˆ˜
49
+ def on_score(file):
50
+ if file is None:
51
+ return [None] * 6
52
+ date_recent, date_old, score_high, score_low, date_recent_file, date_old_file, score_high_file, score_low_file = process_file(file)
53
+ # ์ฒซ๋ฒˆ์งธ ํ™”๋ฉด: ๋ฆฌ๋ทฐ์ ์ˆ˜ ๋‚ด๋ฆผ์ฐจ์ˆœ, ๋‘๋ฒˆ์งธ ํ™”๋ฉด: ๋ฆฌ๋ทฐ์ ์ˆ˜ ์˜ค๋ฆ„์ฐจ์ˆœ
54
+ return score_high, score_low, date_recent_file, date_old_file, score_high_file, score_low_file
55
 
 
56
  # Gradio ์ธํ„ฐํŽ˜์ด์Šค ๊ตฌ์„ฑ
 
 
57
  with gr.Blocks(title="์—‘์…€๋ถ„์„๊ธฐ") as demo:
58
+ # ์—‘์…€ ํŒŒ์ผ ์—…๋กœ๋“œ ์ปดํฌ๋„ŒํŠธ (์—‘์…€ ํŒŒ์ผ ํ™•์žฅ์ž ์ง€์ •)
59
+ file_input = gr.File(label="์—‘์…€ํŒŒ์ผ ์—…๋กœ๋“œ", file_types=[".xlsx", ".xls"])
 
 
 
 
 
 
 
60
 
61
+ # ๋‘ ๊ฐœ์˜ ๋ฒ„ํŠผ ์ƒ์„ฑ
 
 
 
62
  with gr.Row():
63
+ btn_date = gr.Button("๋ฆฌ๋ทฐ๋‚ ์งœ")
64
+ btn_score = gr.Button("๋ฆฌ๋ทฐ์ ์ˆ˜")
65
+
66
+ # ๋‘ ๊ฐœ์˜ ๋ฐ์ดํ„ฐํ”„๋ ˆ์ž„ ์ถœ๋ ฅ ํ™”๋ฉด (A~F ์—ด๋งŒ ํ‘œ์‹œ)
 
 
 
 
 
67
  with gr.Row():
68
+ output1 = gr.Dataframe(label="์ถœ๋ ฅ ํ™”๋ฉด 1 (A~F)")
69
+ output2 = gr.Dataframe(label="์ถœ๋ ฅ ํ™”๋ฉด 2 (A~F)")
70
+
71
+ # ๋‹ค์šด๋กœ๋“œ ๋งํฌ 4๊ฐœ (๊ฐ CSV ํŒŒ์ผ ๋‹ค์šด๋กœ๋“œ)
72
  with gr.Row():
73
+ dl_date_recent = gr.File(label="๋ฆฌ๋ทฐ๋‚ ์งœ ๋‚ด๋ฆผ์ฐจ์ˆœ ๋‹ค์šด๋กœ๋“œ")
74
+ dl_date_old = gr.File(label="๋ฆฌ๋ทฐ๋‚ ์งœ ์˜ค๋ฆ„์ฐจ์ˆœ ๋‹ค์šด๋กœ๋“œ")
 
75
  with gr.Row():
76
+ dl_score_high = gr.File(label="๋ฆฌ๋ทฐ์ ์ˆ˜ ๋‚ด๋ฆผ์ฐจ์ˆœ ๋‹ค์šด๋กœ๋“œ")
77
+ dl_score_low = gr.File(label="๋ฆฌ๋ทฐ์ ์ˆ˜ ์˜ค๋ฆ„์ฐจ์ˆœ ๋‹ค์šด๋กœ๋“œ")
78
+
79
+ # ๋ฒ„ํŠผ ํด๋ฆญ ์‹œ ๊ฐ๊ฐ on_date, on_score ํ•จ์ˆ˜ ํ˜ธ์ถœ
80
+ # ๊ฐ ํ•จ์ˆ˜๋Š” 6๊ฐœ์˜ ๊ฒฐ๊ณผ๊ฐ’์„ ๋ฐ˜ํ™˜ํ•จ: ๋‘ ๊ฐœ์˜ ์ถœ๋ ฅ ํ™”๋ฉด์™€ 4๊ฐœ์˜ ๋‹ค์šด๋กœ๋“œ ํŒŒ์ผ ๊ฒฝ๋กœ
81
+ btn_date.click(on_date, inputs=[file_input], outputs=[output1, output2, dl_date_recent, dl_date_old, dl_score_high, dl_score_low])
82
+ btn_score.click(on_score, inputs=[file_input], outputs=[output1, output2, dl_date_recent, dl_date_old, dl_score_high, dl_score_low])
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
 
84
+ demo.launch()