Update app.py
Browse files
app.py
CHANGED
@@ -30,7 +30,7 @@ def check_zip_files(model_id: str):
|
|
30 |
for file in files:
|
31 |
file_path = file.get('path', '').lower()
|
32 |
if file.get('type') == 'file' and file_path.endswith('.zip'):
|
33 |
-
if any(term in file_path
|
34 |
zip_links.append(f"https://huggingface.co/{model_id}/resolve/main/{file['path']}?download=true")
|
35 |
except requests.exceptions.RequestException as e:
|
36 |
print(f"Error accessing model {model_id}: {e}")
|
@@ -41,7 +41,7 @@ def search_huggingface_zips(user: str):
|
|
41 |
all_links = []
|
42 |
for model in models:
|
43 |
model_id = model.get('modelId', '')
|
44 |
-
if model_id
|
45 |
all_links.extend(check_zip_files(model_id))
|
46 |
return "\n".join(all_links) if all_links else "No ZIP files found."
|
47 |
|
@@ -49,8 +49,8 @@ demo = gr.Interface(
|
|
49 |
fn=search_huggingface_zips,
|
50 |
inputs=gr.Textbox(label="Hugging Face Username"),
|
51 |
outputs=gr.Textbox(label="Download Links"),
|
52 |
-
title="
|
53 |
-
description="Enter a Hugging Face username to search for ZIP files
|
54 |
)
|
55 |
|
56 |
demo.launch()
|
|
|
30 |
for file in files:
|
31 |
file_path = file.get('path', '').lower()
|
32 |
if file.get('type') == 'file' and file_path.endswith('.zip'):
|
33 |
+
if any(term in file_path for term in SEARCH_TERMS):
|
34 |
zip_links.append(f"https://huggingface.co/{model_id}/resolve/main/{file['path']}?download=true")
|
35 |
except requests.exceptions.RequestException as e:
|
36 |
print(f"Error accessing model {model_id}: {e}")
|
|
|
41 |
all_links = []
|
42 |
for model in models:
|
43 |
model_id = model.get('modelId', '')
|
44 |
+
if model_id:
|
45 |
all_links.extend(check_zip_files(model_id))
|
46 |
return "\n".join(all_links) if all_links else "No ZIP files found."
|
47 |
|
|
|
49 |
fn=search_huggingface_zips,
|
50 |
inputs=gr.Textbox(label="Hugging Face Username"),
|
51 |
outputs=gr.Textbox(label="Download Links"),
|
52 |
+
title="Michael Jackson Models Finder",
|
53 |
+
description="Enter a Hugging Face username to search for MJ-related ZIP files in their models.",
|
54 |
)
|
55 |
|
56 |
demo.launch()
|