Spaces:
Sleeping
Sleeping
oliverwang15
commited on
Commit
•
4d47539
1
Parent(s):
630f70c
updates on the requirements.txt
Browse files- app.py +4 -4
- backend.py +2 -0
app.py
CHANGED
@@ -72,12 +72,12 @@ with gr.Blocks(theme="dark") as demo:
|
|
72 |
# Download
|
73 |
with gr.Group():
|
74 |
gr.Markdown(f'<center><h1>Download</h1></center>')
|
75 |
-
gr.Markdown(f'<center><p>Download the
|
76 |
-
answer_file = gr.File(label='Download
|
77 |
-
btn_download_answer = gr.Button(value='Download
|
78 |
btn_download_answer.style(full_width=True)
|
79 |
corrected_file = gr.File(label='Download corrected data', file_types=['.xlsx'])
|
80 |
-
btn_download_corrected = gr.Button(value='Download corrected
|
81 |
btn_download_corrected.style(full_width=True)
|
82 |
|
83 |
|
|
|
72 |
# Download
|
73 |
with gr.Group():
|
74 |
gr.Markdown(f'<center><h1>Download</h1></center>')
|
75 |
+
gr.Markdown(f'<center><p>Download the original LLM answers and corrected LLM answers</p></center>')
|
76 |
+
answer_file = gr.File(label='Download original LLM answers', file_types=['.xlsx'])
|
77 |
+
btn_download_answer = gr.Button(value='Download original LLM answers')
|
78 |
btn_download_answer.style(full_width=True)
|
79 |
corrected_file = gr.File(label='Download corrected data', file_types=['.xlsx'])
|
80 |
+
btn_download_corrected = gr.Button(value='Download corrected LLM answers')
|
81 |
btn_download_corrected.style(full_width=True)
|
82 |
|
83 |
|
backend.py
CHANGED
@@ -155,6 +155,7 @@ class Backend:
|
|
155 |
def download_answer(self, path = './tmp', name = 'answer.xlsx'):
|
156 |
os.makedirs(path, exist_ok = True)
|
157 |
path = os.path.join(path, name)
|
|
|
158 |
self.ori_answer_df.to_excel(path, index = False)
|
159 |
|
160 |
return path
|
@@ -162,6 +163,7 @@ class Backend:
|
|
162 |
def download_corrected(self, path = './tmp', name = 'corrected_answer.xlsx'):
|
163 |
os.makedirs(path, exist_ok = True)
|
164 |
path = os.path.join(path, name)
|
|
|
165 |
self.answer_df.to_excel(path, index = False)
|
166 |
|
167 |
return path
|
|
|
155 |
def download_answer(self, path = './tmp', name = 'answer.xlsx'):
|
156 |
os.makedirs(path, exist_ok = True)
|
157 |
path = os.path.join(path, name)
|
158 |
+
self.ori_answer_df['questions'] = self.questions
|
159 |
self.ori_answer_df.to_excel(path, index = False)
|
160 |
|
161 |
return path
|
|
|
163 |
def download_corrected(self, path = './tmp', name = 'corrected_answer.xlsx'):
|
164 |
os.makedirs(path, exist_ok = True)
|
165 |
path = os.path.join(path, name)
|
166 |
+
self.answer_df['questions'] = self.questions
|
167 |
self.answer_df.to_excel(path, index = False)
|
168 |
|
169 |
return path
|