Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -551,54 +551,54 @@ if __name__ == "__main__":
|
|
551 |
# Define Gradio interface
|
552 |
demo = gr.Blocks()
|
553 |
with demo:
|
554 |
-
|
555 |
|
556 |
-
|
557 |
-
|
558 |
github_token_input = gr.Textbox(label="GitHub Token", type="password")
|
559 |
repo_url_input = gr.Textbox(label="Repository URL")
|
560 |
|
561 |
-
|
562 |
issue_dropdown = gr.Dropdown(label="Select Issue", choices=[])
|
563 |
resolution_textarea = gr.Textbox(label="Resolution", lines=3)
|
564 |
forked_repo_url_input = gr.Textbox(label="Forked Repository URL")
|
565 |
|
566 |
-
|
567 |
output_area = gr.Textbox(label="Output", lines=5)
|
568 |
|
569 |
-
|
570 |
|
571 |
-
|
572 |
-
|
573 |
fetch_issues_button = gr.Button("Fetch Issues")
|
574 |
resolve_button = gr.Button("Resolve Issue")
|
575 |
extract_info_button = gr.Button("Extract Info")
|
576 |
submit_button = gr.Button("Submit")
|
577 |
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
if __name__ == "__main__":
|
604 |
-
|
|
|
551 |
# Define Gradio interface
|
552 |
demo = gr.Blocks()
|
553 |
with demo:
|
554 |
+
gr.HTML(custom_html)
|
555 |
|
556 |
+
# Define all input components first
|
557 |
+
with gr.Row():
|
558 |
github_token_input = gr.Textbox(label="GitHub Token", type="password")
|
559 |
repo_url_input = gr.Textbox(label="Repository URL")
|
560 |
|
561 |
+
with gr.Row():
|
562 |
issue_dropdown = gr.Dropdown(label="Select Issue", choices=[])
|
563 |
resolution_textarea = gr.Textbox(label="Resolution", lines=3)
|
564 |
forked_repo_url_input = gr.Textbox(label="Forked Repository URL")
|
565 |
|
566 |
+
with gr.Row():
|
567 |
output_area = gr.Textbox(label="Output", lines=5)
|
568 |
|
569 |
+
url_textbox = gr.Textbox(label="URL to Extract Info")
|
570 |
|
571 |
+
# Define buttons and their click events
|
572 |
+
with gr.Row():
|
573 |
fetch_issues_button = gr.Button("Fetch Issues")
|
574 |
resolve_button = gr.Button("Resolve Issue")
|
575 |
extract_info_button = gr.Button("Extract Info")
|
576 |
submit_button = gr.Button("Submit")
|
577 |
|
578 |
+
# Connect event handlers
|
579 |
+
fetch_issues_button.click(
|
580 |
+
fn=fetch_issues,
|
581 |
+
inputs=[github_token_input, repo_url_input],
|
582 |
+
outputs=output_area
|
583 |
+
)
|
584 |
+
|
585 |
+
resolve_button.click(
|
586 |
+
fn=resolve_issue,
|
587 |
+
inputs=[github_token_input, repo_url_input, issue_dropdown, resolution_textarea, forked_repo_url_input],
|
588 |
+
outputs=output_area
|
589 |
+
)
|
590 |
+
|
591 |
+
extract_info_button.click(
|
592 |
+
fn=extract_info,
|
593 |
+
inputs=[url_textbox],
|
594 |
+
outputs=output_area
|
595 |
+
)
|
596 |
+
|
597 |
+
submit_button.click(
|
598 |
+
fn=submit_issue,
|
599 |
+
inputs=[github_token_input, repo_url_input, issue_dropdown, resolution_textarea, forked_repo_url_input],
|
600 |
+
outputs=output_area
|
601 |
+
)
|
602 |
+
|
603 |
+
if __name__ == "__main__":
|
604 |
+
demo.launch(share=True)
|