Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -48,6 +48,10 @@ def get_generated_files():
|
|
48 |
files_list = utils.format_directory(OUTPUT_DIR) # This function should list files in the directory
|
49 |
return gr.HTML(f"<h3>Generated Files:</h3><pre><code style='overflow-x: auto'>{files_list}</pre></code>")
|
50 |
|
|
|
|
|
|
|
|
|
51 |
class AutoAPI:
|
52 |
def __init__(self, huggingface_key, ai_name, ai_role, top_5_goals):
|
53 |
self.huggingface_key = huggingface_key
|
@@ -73,7 +77,7 @@ def start(huggingface_key, ai_name, ai_role, top_5_goals, description):
|
|
73 |
return gr.Column.update(visible=False), gr.Column.update(visible=True), gr.update(value=tasks)
|
74 |
except Exception as e:
|
75 |
logger.error("Failed to start AutoAPI: %s", str(e))
|
76 |
-
return gr.Column.update(visible=True
|
77 |
|
78 |
# Main Gradio Interface
|
79 |
with gr.Blocks(css=CSS) as demo:
|
@@ -95,7 +99,7 @@ with gr.Blocks(css=CSS) as demo:
|
|
95 |
|
96 |
start_btn.click(
|
97 |
start,
|
98 |
-
inputs=[api_key, ai_name, ai_role, top_5_goals, description],
|
99 |
outputs=[setup_pane, main_pane, inferred_tasks]
|
100 |
)
|
101 |
|
|
|
48 |
files_list = utils.format_directory(OUTPUT_DIR) # This function should list files in the directory
|
49 |
return gr.HTML(f"<h3>Generated Files:</h3><pre><code style='overflow-x: auto'>{files_list}</pre></code>")
|
50 |
|
51 |
+
def get_download_btn():
|
52 |
+
"""Get download all files button."""
|
53 |
+
return gr.Button("Download All Files", elem_id="download-btn")
|
54 |
+
|
55 |
class AutoAPI:
|
56 |
def __init__(self, huggingface_key, ai_name, ai_role, top_5_goals):
|
57 |
self.huggingface_key = huggingface_key
|
|
|
77 |
return gr.Column.update(visible=False), gr.Column.update(visible=True), gr.update(value=tasks)
|
78 |
except Exception as e:
|
79 |
logger.error("Failed to start AutoAPI: %s", str(e))
|
80 |
+
return gr.Column.update(visible=True), gr.Column.update(visible=False), gr.update(value=[])
|
81 |
|
82 |
# Main Gradio Interface
|
83 |
with gr.Blocks(css=CSS) as demo:
|
|
|
99 |
|
100 |
start_btn.click(
|
101 |
start,
|
102 |
+
inputs=[api_key, ai_name , ai_role, top_5_goals, description],
|
103 |
outputs=[setup_pane, main_pane, inferred_tasks]
|
104 |
)
|
105 |
|