Expose function available_models (#475)
* Expose function available_models * Add test case
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user