Skip to content

Commit

Permalink
Add test for SD
Browse files Browse the repository at this point in the history
  • Loading branch information
monorimet committed Jan 17, 2024
1 parent 7a0017d commit a43c559
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions apps/shark_studio/tests/api_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,26 @@

import logging
import unittest
import json

from apps.shark_studio.api.llm import LanguageModel
from apps.shark_studio.api.sd import shark_sd_fn_dict_input, view_json_file
from apps.shark_studio.web.utils.file_utils import get_resource_path

class SDAPITest(unittest.TestCase):
def testSDSimple(self):
from apps.shark_studio.modules.shared_cmd_opts import cmd_opts
import apps.shark_studio.web.utils.globals as global_obj

global_obj._init()

sd_json = view_json_file(get_resource_path("../configs/default_sd_config.json"))
sd_kwargs = json.loads(sd_json)
for arg in vars(cmd_opts):
if arg in sd_kwargs:
sd_kwargs[arg] = getattr(cmd_opts, arg)
for i in shark_sd_fn_dict_input(sd_kwargs):
print(i)

class LLMAPITest(unittest.TestCase):
def testLLMSimple(self):
Expand Down

0 comments on commit a43c559

Please sign in to comment.