Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,13 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
def append_text_to_file(text):
|
| 4 |
file_path = 'text_file.txt'
|
| 5 |
with open(file_path, 'a') as file:
|
|
@@ -12,8 +20,9 @@ def append_text_to_file(text):
|
|
| 12 |
with gr.Blocks() as demo:
|
| 13 |
tb_input = gr.Textbox(label='enter some text')
|
| 14 |
fi_output = gr.File(type='binary')
|
| 15 |
-
|
| 16 |
-
|
|
|
|
| 17 |
tb_input.submit(append_text_to_file, inputs=tb_input, outputs=fi_output)
|
| 18 |
|
| 19 |
demo.launch(debug=True)
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
+
def list_attributes_and_values(obj):
|
| 4 |
+
attributes = dir(obj)
|
| 5 |
+
for attr in attributes:
|
| 6 |
+
# Filter out special (magic) methods and attributes
|
| 7 |
+
if not attr.startswith('__'):
|
| 8 |
+
value = getattr(obj, attr)
|
| 9 |
+
print(f"{attr}: {value}")
|
| 10 |
+
|
| 11 |
def append_text_to_file(text):
|
| 12 |
file_path = 'text_file.txt'
|
| 13 |
with open(file_path, 'a') as file:
|
|
|
|
| 20 |
with gr.Blocks() as demo:
|
| 21 |
tb_input = gr.Textbox(label='enter some text')
|
| 22 |
fi_output = gr.File(type='binary')
|
| 23 |
+
|
| 24 |
+
list_attributes_and_values(fi_output)
|
| 25 |
+
|
| 26 |
tb_input.submit(append_text_to_file, inputs=tb_input, outputs=fi_output)
|
| 27 |
|
| 28 |
demo.launch(debug=True)
|