mirror of
https://github.com/theroyallab/tabbyAPI.git
synced 2026-03-15 00:07:28 +00:00
API: Split into separate folder
Moving the API into its own directory helps compartmentalize it and allows for cleaning up the main file to just contain bootstrapping and the entry point. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
14
endpoints/OAI/utils/lora.py
Normal file
14
endpoints/OAI/utils/lora.py
Normal file
@@ -0,0 +1,14 @@
|
||||
import pathlib
|
||||
|
||||
from endpoints.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
|
||||
Reference in New Issue
Block a user