Spaces:
Sleeping
Sleeping
Allen Park
commited on
Commit
·
b2da20e
1
Parent(s):
34e4cb8
change filename from textbox to label
Browse files
app.py
CHANGED
@@ -134,12 +134,12 @@ def model_call(question, document, answer, client_base_url):
|
|
134 |
def upload_file(filepath):
|
135 |
if filepath is not None:
|
136 |
name = Path(filepath).name
|
137 |
-
return [gr.UploadButton(visible=False), gr.ClearButton(visible=True), gr.
|
138 |
else:
|
139 |
-
return [gr.UploadButton(visible=True), gr.ClearButton(visible=False), gr.
|
140 |
# return [gr.UploadButton(visible=False), gr.DownloadButton(label=f"Download {name}", value=filepath, visible=True)]
|
141 |
def reset_buttons():
|
142 |
-
return [gr.UploadButton(visible=True), gr.ClearButton(visible=False), gr.
|
143 |
|
144 |
# def download_file():
|
145 |
# return [gr.UploadButton(visible=True), gr.DownloadButton(visible=False)]
|
@@ -166,7 +166,7 @@ with gr.Blocks(css=css) as demo:
|
|
166 |
u = gr.UploadButton("Upload", file_count="single", scale=1)
|
167 |
c = gr.ClearButton([u], visible=False, scale=1)
|
168 |
# d = gr.DownloadButton("Download the file", visible=False, scale=1)
|
169 |
-
file_name = gr.
|
170 |
with gr.Row():
|
171 |
document = gr.Textbox(label="Document")
|
172 |
with gr.Row():
|
|
|
134 |
def upload_file(filepath):
|
135 |
if filepath is not None:
|
136 |
name = Path(filepath).name
|
137 |
+
return [gr.UploadButton(visible=False), gr.ClearButton(visible=True), gr.Label(value=name)]
|
138 |
else:
|
139 |
+
return [gr.UploadButton(visible=True), gr.ClearButton(visible=False), gr.Label(value="")]
|
140 |
# return [gr.UploadButton(visible=False), gr.DownloadButton(label=f"Download {name}", value=filepath, visible=True)]
|
141 |
def reset_buttons():
|
142 |
+
return [gr.UploadButton(visible=True), gr.ClearButton(visible=False), gr.Label(value="")]
|
143 |
|
144 |
# def download_file():
|
145 |
# return [gr.UploadButton(visible=True), gr.DownloadButton(visible=False)]
|
|
|
166 |
u = gr.UploadButton("Upload", file_count="single", scale=1)
|
167 |
c = gr.ClearButton([u], visible=False, scale=1)
|
168 |
# d = gr.DownloadButton("Download the file", visible=False, scale=1)
|
169 |
+
file_name = gr.Label(label="Uploaded File")
|
170 |
with gr.Row():
|
171 |
document = gr.Textbox(label="Document")
|
172 |
with gr.Row():
|