Spaces:
Paused
Paused
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -169,7 +169,10 @@ def handle_generate(theme, customer_profile, num_personas):
|
|
| 169 |
except Exception as e:
|
| 170 |
yield f"Error during generation: {str(e)}", None, None
|
| 171 |
|
| 172 |
-
def start_and_monitor_sessions(
|
|
|
|
|
|
|
|
|
|
| 173 |
if not JULES_API_KEY:
|
| 174 |
yield "Error: JULES_API_KEY not set.", ""
|
| 175 |
return
|
|
@@ -277,10 +280,6 @@ with gr.Blocks() as demo:
|
|
| 277 |
num_personas_input = gr.Number(label="Number of Personas", value=1, precision=0)
|
| 278 |
url_input = gr.Textbox(label="Target URL", value="https://example.com")
|
| 279 |
|
| 280 |
-
repo_selector = gr.Dropdown(label="GitHub Repository", choices=get_user_repos(), value="JsonLord/tiny_web")
|
| 281 |
-
branch_selector = gr.Dropdown(label="Branch", choices=["main"], value="main")
|
| 282 |
-
|
| 283 |
-
repo_selector.change(fn=get_repo_branches, inputs=repo_selector, outputs=branch_selector)
|
| 284 |
|
| 285 |
generate_btn = gr.Button("Generate Personas & Tasks")
|
| 286 |
|
|
@@ -304,7 +303,7 @@ with gr.Blocks() as demo:
|
|
| 304 |
|
| 305 |
start_session_btn.click(
|
| 306 |
fn=start_and_monitor_sessions,
|
| 307 |
-
inputs=[
|
| 308 |
outputs=[status_output, report_output]
|
| 309 |
)
|
| 310 |
|
|
|
|
| 169 |
except Exception as e:
|
| 170 |
yield f"Error during generation: {str(e)}", None, None
|
| 171 |
|
| 172 |
+
def start_and_monitor_sessions(personas, tasks, url):
|
| 173 |
+
repo_name = "JsonLord/tiny_web"
|
| 174 |
+
branch_name = "main"
|
| 175 |
+
|
| 176 |
if not JULES_API_KEY:
|
| 177 |
yield "Error: JULES_API_KEY not set.", ""
|
| 178 |
return
|
|
|
|
| 280 |
num_personas_input = gr.Number(label="Number of Personas", value=1, precision=0)
|
| 281 |
url_input = gr.Textbox(label="Target URL", value="https://example.com")
|
| 282 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 283 |
|
| 284 |
generate_btn = gr.Button("Generate Personas & Tasks")
|
| 285 |
|
|
|
|
| 303 |
|
| 304 |
start_session_btn.click(
|
| 305 |
fn=start_and_monitor_sessions,
|
| 306 |
+
inputs=[persona_display, task_list_display, url_input],
|
| 307 |
outputs=[status_output, report_output]
|
| 308 |
)
|
| 309 |
|