Enable HTML upload
This commit is contained in:
parent
65852b7d71
commit
107bc7580e
|
@ -5,24 +5,18 @@ from ktem.app import BasePage
|
||||||
class FileUpload(BasePage):
|
class FileUpload(BasePage):
|
||||||
def __init__(self, app):
|
def __init__(self, app):
|
||||||
self._app = app
|
self._app = app
|
||||||
|
self._supported_file_types = [
|
||||||
|
"image", ".pdf", ".txt", ".csv", ".xlsx", ".doc", ".docx", ".pptx", ".html"
|
||||||
|
]
|
||||||
self.on_building_ui()
|
self.on_building_ui()
|
||||||
|
|
||||||
def on_building_ui(self):
|
def on_building_ui(self):
|
||||||
with gr.Accordion(label="File upload", open=False):
|
with gr.Accordion(label="File upload", open=False):
|
||||||
gr.Markdown(
|
gr.Markdown(
|
||||||
"Supported file types: image, pdf, txt, csv, xlsx, docx, doc, pptx.",
|
f"Supported file types: {', '.join(self._supported_file_types)}",
|
||||||
)
|
)
|
||||||
self.files = gr.File(
|
self.files = gr.File(
|
||||||
file_types=[
|
file_types=self._supported_file_types,
|
||||||
"image",
|
|
||||||
".pdf",
|
|
||||||
".txt",
|
|
||||||
".csv",
|
|
||||||
".xlsx",
|
|
||||||
".doc",
|
|
||||||
".docx",
|
|
||||||
".pptx",
|
|
||||||
],
|
|
||||||
file_count="multiple",
|
file_count="multiple",
|
||||||
container=False,
|
container=False,
|
||||||
height=50,
|
height=50,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user