mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 09:14:35 +02:00
Merge pull request #3368 from osanseviero/master
Update to new Hugging Face stuff
This commit is contained in:
@@ -308,7 +308,7 @@ def find_diffuser(name: str):
|
||||
models = list(hf_api.list_models(filter=hf_filter, full=True, limit=20, sort="downloads", direction=-1))
|
||||
shared.log.debug(f'Searching diffusers models: {name} {len(models) > 0}')
|
||||
if len(models) > 0:
|
||||
return models[0].modelId
|
||||
return models[0].id
|
||||
return None
|
||||
|
||||
|
||||
|
||||
@@ -362,12 +362,11 @@ def create_ui():
|
||||
def hf_search(keyword):
|
||||
import huggingface_hub as hf
|
||||
hf_api = hf.HfApi()
|
||||
model_filter = hf.ModelFilter(model_name=keyword, library=['diffusers'])
|
||||
models = hf_api.list_models(filter=model_filter, full=True, limit=50, sort="downloads", direction=-1)
|
||||
models = hf_api.list_models(model_name=keyword, full=True, library="diffusers", limit=50, sort="downloads", direction=-1)
|
||||
data.clear()
|
||||
for model in models:
|
||||
tags = [t for t in model.tags if not t.startswith('diffusers') and not t.startswith('license') and not t.startswith('arxiv') and len(t) > 2]
|
||||
data.append([model.modelId, model.pipeline_tag, tags, model.downloads, model.lastModified, f'https://huggingface.co/{model.modelId}'])
|
||||
data.append([model.id, model.pipeline_tag, tags, model.downloads, model.lastModified, f'https://huggingface.co/{model.id}'])
|
||||
return data
|
||||
|
||||
def hf_select(evt: gr.SelectData, data):
|
||||
|
||||
Reference in New Issue
Block a user