Spaces:
Sleeping
Sleeping
Update textbox_with_upload.py
Browse files- textbox_with_upload.py +0 -7
textbox_with_upload.py
CHANGED
@@ -3,10 +3,6 @@ import gradio as gr
|
|
3 |
class TextboxWithUpload(gr.Textbox):
|
4 |
def __init__(self, *args, **kwargs):
|
5 |
super().__init__(*args, **kwargs)
|
6 |
-
self.upload_button = None
|
7 |
-
self.add_upload_button()
|
8 |
-
|
9 |
-
def add_upload_button(self):
|
10 |
self.upload_button = gr.UploadButton("π", file_types=["text"], file_count="single")
|
11 |
self.upload_button.upload(self.handle_upload, inputs=[self.upload_button], outputs=[self])
|
12 |
|
@@ -16,9 +12,6 @@ class TextboxWithUpload(gr.Textbox):
|
|
16 |
return ""
|
17 |
|
18 |
def render(self):
|
19 |
-
return self.render_with_upload_button()
|
20 |
-
|
21 |
-
def render_with_upload_button(self):
|
22 |
textbox = super().render()
|
23 |
upload_button = self.upload_button.render()
|
24 |
return gr.Row([textbox, upload_button])
|
|
|
3 |
class TextboxWithUpload(gr.Textbox):
|
4 |
def __init__(self, *args, **kwargs):
|
5 |
super().__init__(*args, **kwargs)
|
|
|
|
|
|
|
|
|
6 |
self.upload_button = gr.UploadButton("π", file_types=["text"], file_count="single")
|
7 |
self.upload_button.upload(self.handle_upload, inputs=[self.upload_button], outputs=[self])
|
8 |
|
|
|
12 |
return ""
|
13 |
|
14 |
def render(self):
|
|
|
|
|
|
|
15 |
textbox = super().render()
|
16 |
upload_button = self.upload_button.render()
|
17 |
return gr.Row([textbox, upload_button])
|