Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -144,7 +144,7 @@ paperid: {paperid}
|
|
144 |
def makepreview(x):
|
145 |
return x
|
146 |
def upload(prefix, fname, ext, file):
|
147 |
-
fname = prefix+fname
|
148 |
with fs.open(datasetdir+"uploads/"+fname+"."+ext, "wb") as f:
|
149 |
f.write(file)
|
150 |
return f"uploaded, use https://huggingface.co/datasets/yoinked/blue-arxiv-papers/resolve/main/uploads/{fname}.{ext} to include in your paper (so like ![image](https://huggingface.co/datasets/yoinked/blue-arxiv-papers/resolve/main/uploads/{fname}.{ext})) for inline img"
|
@@ -180,9 +180,10 @@ with gr.Blocks(css=basecss, theme='NoCrypt/miku') as demo:
|
|
180 |
file_name = gr.Textbox(label="file name", lines=1, interactive=True)
|
181 |
with gr.Row():
|
182 |
file = gr.File(label="file", file_types=[".png", ".gif", ".webp", ".jpg", ".wav", ".mp3"])
|
183 |
-
fileext = gr.Dropdown(["png", "gif", "webp", "jpg", "wav", "mp3"])
|
184 |
uploadbutton = gr.Button("upload")
|
185 |
-
|
|
|
186 |
markd.change(fn=makepreview, inputs=markd, outputs=preview)
|
187 |
publishbutton.click(fn=publish_paper, inputs=[title, authors, tags, abst, markd], outputs=status)
|
188 |
searchbutton.click(fn=make_paper_cards, inputs=query, outputs=papercards)
|
|
|
144 |
def makepreview(x):
|
145 |
return x
|
146 |
def upload(prefix, fname, ext, file):
|
147 |
+
fname = prefix+"-"+fname
|
148 |
with fs.open(datasetdir+"uploads/"+fname+"."+ext, "wb") as f:
|
149 |
f.write(file)
|
150 |
return f"uploaded, use https://huggingface.co/datasets/yoinked/blue-arxiv-papers/resolve/main/uploads/{fname}.{ext} to include in your paper (so like ![image](https://huggingface.co/datasets/yoinked/blue-arxiv-papers/resolve/main/uploads/{fname}.{ext})) for inline img"
|
|
|
180 |
file_name = gr.Textbox(label="file name", lines=1, interactive=True)
|
181 |
with gr.Row():
|
182 |
file = gr.File(label="file", file_types=[".png", ".gif", ".webp", ".jpg", ".wav", ".mp3"])
|
183 |
+
fileext = gr.Dropdown(label="filetype", ["png", "gif", "webp", "jpg", "wav", "mp3"])
|
184 |
uploadbutton = gr.Button("upload")
|
185 |
+
statii = gr.Textbox(label="status", interactive=False)
|
186 |
+
uploadbutton.click(fn=upload, inputs=[prefix, file_name, fileext, file], outputs=statii)
|
187 |
markd.change(fn=makepreview, inputs=markd, outputs=preview)
|
188 |
publishbutton.click(fn=publish_paper, inputs=[title, authors, tags, abst, markd], outputs=status)
|
189 |
searchbutton.click(fn=make_paper_cards, inputs=query, outputs=papercards)
|