Update app.py
Browse files
app.py
CHANGED
@@ -53,56 +53,44 @@ def process_csv(csv_file):
|
|
53 |
os.rename(output_path, new_path)
|
54 |
|
55 |
return new_path
|
56 |
-
|
57 |
-
def process_csv_tab1(csv_file):
|
58 |
-
# CSVファイルの処理ロジック(タブ1用)
|
59 |
-
# ここでCSVファイルを処理して、結果のCSVファイルを生成
|
60 |
-
return csv_file
|
61 |
-
|
62 |
-
def process_csv_tab2(csv_file):
|
63 |
-
# CSVファイルの処理ロジック(タブ2用)
|
64 |
-
# ここでCSVファイルを処理して、結果のCSVファイルを生成
|
65 |
-
return csv_file
|
66 |
-
|
67 |
-
def process_csv_tab3(csv_file):
|
68 |
-
# CSVファイルの処理ロジック(タブ3用)
|
69 |
-
# ここでCSVファイルを処理して、結果のCSVファイルを生成
|
70 |
-
return csv_file
|
71 |
-
|
72 |
-
def process_csv(csv_file):
|
73 |
-
# CSV処理ロジックの実装。ここでは、入力されたCSVファイルをそのまま返します。
|
74 |
-
# 実際には、ファイルを読み込み、加工し、新しいファイルを生成する処理をここに実装します。
|
75 |
return csv_file
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
with gr.
|
96 |
-
with gr.
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
os.rename(output_path, new_path)
|
54 |
|
55 |
return new_path
|
56 |
+
def testCSV(csv_file):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
return csv_file
|
58 |
+
# interface = gr.Interface(
|
59 |
+
# fn=process_csv,
|
60 |
+
# inputs=gr.File(label="CSVファイルをアップロード"),
|
61 |
+
# outputs=gr.File(label="ダウンロード", file_count="singular"),
|
62 |
+
# allow_flagging="never",
|
63 |
+
# title="問題生成ツール",
|
64 |
+
# article="問題生成FMTは<a href='https://drive.google.com/uc?export=download&id=1fNAco8IDXl3B-mTzlUcGyAz1hOtZyL6V' target='_blank'>こちら</a>からダウンロードしてください。"
|
65 |
+
|
66 |
+
# )
|
67 |
+
|
68 |
+
title = "英語生成ツール"
|
69 |
+
|
70 |
+
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
71 |
+
gr.Markdown(
|
72 |
+
f"""
|
73 |
+
# {title}
|
74 |
+
"""
|
75 |
+
)
|
76 |
+
with gr.Tab("問題生成(選択肢)"):
|
77 |
+
with gr.Column():
|
78 |
+
with gr.Row():
|
79 |
+
inputs=gr.File(label="CSVファイルをアップロード")
|
80 |
+
outputs=gr.File(label="ダウンロード", file_count="singular")
|
81 |
+
gr.Button("校正スタート").click(
|
82 |
+
testCSV,
|
83 |
+
inputs=[inputs],
|
84 |
+
outputs=[outputs]
|
85 |
+
)
|
86 |
+
with gr.Tab("問題生成(並び替え)"):
|
87 |
+
with gr.Column():
|
88 |
+
with gr.Row():
|
89 |
+
inputs=gr.File(label="CSVファイルをアップロード")
|
90 |
+
outputs=gr.File(label="ダウンロード", file_count="singular")
|
91 |
+
gr.Button("校正スタート").click(
|
92 |
+
testCSV,
|
93 |
+
inputs=[inputs],
|
94 |
+
outputs=[outputs]
|
95 |
+
)
|
96 |
+
demo.launch(share=True)
|