mirror of
https://github.com/theroyallab/tabbyAPI.git
synced 2026-04-19 22:08:59 +00:00
Just like types, put utility functions in their own separate module based on the route. Signed-off-by: kingbri <bdashore3@proton.me>
15 lines
402 B
Python
15 lines
402 B
Python
import pathlib
|
|
|
|
from OAI.types.lora import LoraCard, LoraList
|
|
|
|
|
|
def get_lora_list(lora_path: pathlib.Path):
|
|
"""Get the list of Lora cards from the provided path."""
|
|
lora_list = LoraList()
|
|
for path in lora_path.iterdir():
|
|
if path.is_dir():
|
|
lora_card = LoraCard(id=path.name)
|
|
lora_list.data.append(lora_card) # pylint: disable=no-member
|
|
|
|
return lora_list
|