Expose function available_models (#475)

* Expose function available_models

* Add test case
This commit is contained in:
Guillaume Klein
2023-09-14 17:17:01 +02:00
committed by GitHub
parent a49097e655
commit 0048844f54
3 changed files with 15 additions and 3 deletions

View File

@@ -2,7 +2,7 @@ import logging
import os
import re
from typing import Optional
from typing import List, Optional
import huggingface_hub
import requests
@@ -24,6 +24,11 @@ _MODELS = {
}
def available_models() -> List[str]:
"""Returns the names of available models."""
return list(_MODELS.keys())
def get_assets_path():
"""Returns the path to the assets directory."""
return os.path.join(os.path.dirname(os.path.abspath(__file__)), "assets")