Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -32,7 +32,9 @@ def extract_and_display(url):
|
|
32 |
|
33 |
def handle_model_summary(model_name):
|
34 |
model_summary, error_message = get_model_summary(model_name)
|
35 |
-
|
|
|
|
|
36 |
|
37 |
# Create Gradio App
|
38 |
app = gr.Blocks(theme="sudeepshouche/minimalist")
|
@@ -62,5 +64,23 @@ with app:
|
|
62 |
model_submit_button = gr.Button("Submit")
|
63 |
model_submit_button.click(fn=handle_model_summary, inputs=model_name_input, outputs=[model_output, error_output])
|
64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
if __name__ == "__main__":
|
66 |
app.launch()
|
|
|
32 |
|
33 |
def handle_model_summary(model_name):
|
34 |
model_summary, error_message = get_model_summary(model_name)
|
35 |
+
if error_message:
|
36 |
+
return error_message, ""
|
37 |
+
return model_summary, ""
|
38 |
|
39 |
# Create Gradio App
|
40 |
app = gr.Blocks(theme="sudeepshouche/minimalist")
|
|
|
64 |
model_submit_button = gr.Button("Submit")
|
65 |
model_submit_button.click(fn=handle_model_summary, inputs=model_name_input, outputs=[model_output, error_output])
|
66 |
|
67 |
+
with gr.Tab("Non-HF Repository Extraction"):
|
68 |
+
gr.Markdown("# Non-Hugging Face Repository Content Extractor")
|
69 |
+
non_hf_url_input = gr.Textbox(label="Repository URL", placeholder="Enter the non-Hugging Face repository URL here...")
|
70 |
+
non_hf_output_display = gr.Textbox(label="Extracted Repository Content", show_copy_button=True, lines=20, placeholder="Repository content will be extracted here...")
|
71 |
+
non_hf_extract_button = gr.Button("Extract Content")
|
72 |
+
non_hf_extract_button.click(fn=extract_and_display, inputs=non_hf_url_input, outputs=non_hf_output_display)
|
73 |
+
|
74 |
+
gr.Markdown("### Filter and Selector Options")
|
75 |
+
file_type_filter = gr.CheckboxGroup(label="File Types", choices=[".txt", ".py", ".md", ".json", ".yaml", ".csv"])
|
76 |
+
file_size_slider = gr.Slider(label="File Size Limit (KB)", minimum=0, maximum=1024, value=32, step=1)
|
77 |
+
intelligent_retrieval_checkbox = gr.Checkbox(label="Enable Intelligent Retrieval")
|
78 |
+
|
79 |
+
non_hf_extract_button.click(
|
80 |
+
fn=extract_and_display,
|
81 |
+
inputs=[non_hf_url_input, file_type_filter, file_size_slider, intelligent_retrieval_checkbox],
|
82 |
+
outputs=non_hf_output_display
|
83 |
+
)
|
84 |
+
|
85 |
if __name__ == "__main__":
|
86 |
app.launch()
|