python package restructuring
This commit is contained in:
@@ -1,32 +1,20 @@
|
||||
import pytest
|
||||
import tests.helper as helper
|
||||
from tests import helper
|
||||
|
||||
|
||||
inference = None
|
||||
InferenceClass = None
|
||||
Tensor = None
|
||||
|
||||
|
||||
def prepare():
|
||||
if InferenceClass == None:
|
||||
test_import_inference_module_librarys()
|
||||
if inference == None:
|
||||
test_instantiate_inference_instance()
|
||||
|
||||
|
||||
def test_import_inference_module_librarys():
|
||||
import inference
|
||||
import torch
|
||||
global InferenceClass
|
||||
global Tensor
|
||||
InferenceClass = inference.Inference
|
||||
Tensor = torch.Tensor
|
||||
|
||||
|
||||
def test_instantiate_inference_instance():
|
||||
if InferenceClass == None:
|
||||
test_import_inference_module_librarys()
|
||||
global inference
|
||||
inference = InferenceClass()
|
||||
global Tensor
|
||||
if inference == None:
|
||||
from torch import Tensor as _Tensor
|
||||
from chatbug.inference import Inference
|
||||
from chatbug.model_selection import get_model
|
||||
inference = Inference(get_model())
|
||||
Tensor = _Tensor
|
||||
|
||||
|
||||
def test_tool_header_generation():
|
||||
|
Reference in New Issue
Block a user