kostis-init commited on
Commit
cd74708
Β·
1 Parent(s): 2862155

add test upload

Browse files
Files changed (1) hide show
  1. app.py +22 -7
app.py CHANGED
@@ -89,7 +89,9 @@ def init_leaderboard(dataframe):
89
  )
90
 
91
 
92
- demo = gr.Blocks(css=custom_css)
 
 
93
  with demo:
94
  gr.HTML(TITLE)
95
  gr.Markdown(INTRODUCTION_TEXT, elem_classes="markdown-text")
@@ -102,18 +104,31 @@ with demo:
102
  gr.Markdown(LLM_BENCHMARKS_TEXT, elem_classes="markdown-text")
103
 
104
  with gr.TabItem("πŸš€ Simple Submit here!", elem_id="llm-benchmark-tab-table", id=4):
105
- # in this tab, we will have a simple submit button accepting multiple files (or a folder)
106
  gr.Markdown(
107
- "## Submit your generated models here! (for now, only a few models are supported)",
108
  elem_classes="markdown-text",
109
  )
110
- # upload
111
- gr.UploadButton(
112
- label="Upload your generated models",
113
  size="lg",
114
- file_count="multiple",
 
 
115
  )
116
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
 
118
 
119
  with gr.TabItem("πŸš€ Submit here!", elem_id="llm-benchmark-tab-table", id=3):
 
89
  )
90
 
91
 
92
+ # demo = gr.Blocks(css=custom_css)
93
+ demo = gr.Blocks()
94
+
95
  with demo:
96
  gr.HTML(TITLE)
97
  gr.Markdown(INTRODUCTION_TEXT, elem_classes="markdown-text")
 
104
  gr.Markdown(LLM_BENCHMARKS_TEXT, elem_classes="markdown-text")
105
 
106
  with gr.TabItem("πŸš€ Simple Submit here!", elem_id="llm-benchmark-tab-table", id=4):
 
107
  gr.Markdown(
108
+ "## Submit your generated models here!",
109
  elem_classes="markdown-text",
110
  )
111
+ upload_button = gr.UploadButton(
112
+ label="Upload your generated models (only directories accepted)",
 
113
  size="lg",
114
+ file_count="directory",
115
+ elem_id="upload-button",
116
+ file_types=["text"],
117
  )
118
 
119
+ # when the directory is uploaded, we need to save it under the submissions folder
120
+ def upload_directory(directory):
121
+ # Save the directory to the EVAL_REQUESTS_PATH
122
+ directory_path = directory.name
123
+ if directory_path:
124
+ # Move the uploaded directory to the desired location
125
+ import shutil
126
+
127
+ shutil.move(directory_path, "submissions/")
128
+ return f"Directory {directory_path} uploaded successfully!"
129
+ else:
130
+ return "No directory uploaded."
131
+
132
 
133
 
134
  with gr.TabItem("πŸš€ Submit here!", elem_id="llm-benchmark-tab-table", id=3):