Skip to content

Commit a43c559

Browse files
committed
Add test for SD
1 parent 7a0017d commit a43c559

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

apps/shark_studio/tests/api_test.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,26 @@
66

77
import logging
88
import unittest
9+
import json
10+
911
from apps.shark_studio.api.llm import LanguageModel
12+
from apps.shark_studio.api.sd import shark_sd_fn_dict_input, view_json_file
13+
from apps.shark_studio.web.utils.file_utils import get_resource_path
14+
15+
class SDAPITest(unittest.TestCase):
16+
def testSDSimple(self):
17+
from apps.shark_studio.modules.shared_cmd_opts import cmd_opts
18+
import apps.shark_studio.web.utils.globals as global_obj
19+
20+
global_obj._init()
1021

22+
sd_json = view_json_file(get_resource_path("../configs/default_sd_config.json"))
23+
sd_kwargs = json.loads(sd_json)
24+
for arg in vars(cmd_opts):
25+
if arg in sd_kwargs:
26+
sd_kwargs[arg] = getattr(cmd_opts, arg)
27+
for i in shark_sd_fn_dict_input(sd_kwargs):
28+
print(i)
1129

1230
class LLMAPITest(unittest.TestCase):
1331
def testLLMSimple(self):

0 commit comments

Comments
 (0)