Spaces:
Running
Running
tripleS-Dev
commited on
Commit
โข
100d5f6
1
Parent(s):
93cd768
update V1.2.0L Beta
Browse files-Rekord member dropdown
fn.py
CHANGED
@@ -50,4 +50,20 @@ def remove(filename):
|
|
50 |
# ํ์ผ์ด zip ํ์ผ์ธ์ง ํ์ธ
|
51 |
if filename.endswith('.zip'):
|
52 |
# ํ์ผ ์ญ์
|
53 |
-
os.remove(file_path)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
# ํ์ผ์ด zip ํ์ผ์ธ์ง ํ์ธ
|
51 |
if filename.endswith('.zip'):
|
52 |
# ํ์ผ ์ญ์
|
53 |
+
os.remove(file_path)
|
54 |
+
|
55 |
+
|
56 |
+
def transform_number(n):
|
57 |
+
if n < 1 or n > 29:
|
58 |
+
raise ValueError("์
๋ ฅ ๊ฐ์ 1๋ถํฐ 29 ์ฌ์ด์ฌ์ผ ํฉ๋๋ค.")
|
59 |
+
|
60 |
+
if 1 <= n <= 14:
|
61 |
+
return n
|
62 |
+
elif n == 15:
|
63 |
+
return 19
|
64 |
+
elif 16 <= n <= 24:
|
65 |
+
return n + 5
|
66 |
+
elif 25 <= n <= 28:
|
67 |
+
return n - 10
|
68 |
+
elif n == 29:
|
69 |
+
return 20
|
main.py
CHANGED
@@ -189,7 +189,11 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo: # , js=js_func
|
|
189 |
event_generate.click(fn=generate.event, inputs=[event_img, event_radio, event_txt, event_position], outputs=event_output)
|
190 |
with gr.Tab("ReKord", visible=False) as rec:
|
191 |
rekord_img = gr.Image(type="filepath")
|
192 |
-
|
|
|
|
|
|
|
|
|
193 |
rekord_submit = gr.Button()
|
194 |
rekord_out = gr.Textbox()
|
195 |
rekord_submit.click(fn=rekord.upload, inputs=[rekord_img, rekord_member], outputs=rekord_out)
|
|
|
189 |
event_generate.click(fn=generate.event, inputs=[event_img, event_radio, event_txt, event_position], outputs=event_output)
|
190 |
with gr.Tab("ReKord", visible=False) as rec:
|
191 |
rekord_img = gr.Image(type="filepath")
|
192 |
+
|
193 |
+
rekord_member = gr.Dropdown(
|
194 |
+
["SeoYeon", "HyeRin", "JiWoo", "ChaeYeon", "YooYeon", "SooMin", "NaKyoung", "YuBin", "Kaede",
|
195 |
+
"DaHyun", "Kotone", "YeonJi", "Nien", "SoHyun", "Xinyu", "Mayu", "Lynn", "JooBin", "HaYeon",
|
196 |
+
"ShiOn", "ChaeWon", "Sullin", "SeoAh", "JiYeon", "HeeJin", "KimLip", "JinSoul", "Choerry", "HaSeul"], label="Sign", type='index')
|
197 |
rekord_submit = gr.Button()
|
198 |
rekord_out = gr.Textbox()
|
199 |
rekord_submit.click(fn=rekord.upload, inputs=[rekord_img, rekord_member], outputs=rekord_out)
|
rekord.py
CHANGED
@@ -1,9 +1,10 @@
|
|
1 |
import requests
|
|
|
2 |
|
3 |
|
4 |
def upload(img_path, member):
|
5 |
|
6 |
-
member =
|
7 |
|
8 |
url = "https://api.cosmo.fans/rekord/v1/post/"
|
9 |
headers = {
|
|
|
1 |
import requests
|
2 |
+
import fn
|
3 |
|
4 |
|
5 |
def upload(img_path, member):
|
6 |
|
7 |
+
member = fn.transform_number(member)
|
8 |
|
9 |
url = "https://api.cosmo.fans/rekord/v1/post/"
|
10 |
headers = {
|