mirror of
https://github.com/qurator-spk/eynollah.git
synced 2025-11-10 06:34:11 +01:00
wip
This commit is contained in:
parent
ec1fd93dad
commit
294b6356d3
6 changed files with 41 additions and 9 deletions
19
tests/test_model_zoo.py
Normal file
19
tests/test_model_zoo.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
from pathlib import Path
|
||||
|
||||
from eynollah.model_zoo import EynollahModelZoo, TrOCRProcessor, VisionEncoderDecoderModel
|
||||
|
||||
testdir = Path(__file__).parent.resolve()
|
||||
MODELS_DIR = testdir.parent
|
||||
|
||||
def test_trocr1():
|
||||
model_zoo = EynollahModelZoo(str(MODELS_DIR))
|
||||
model_zoo.load_model('trocr_processor')
|
||||
proc = model_zoo.get('trocr_processor', TrOCRProcessor)
|
||||
assert isinstance(proc, TrOCRProcessor)
|
||||
|
||||
model_zoo.load_model('ocr', 'tr')
|
||||
model = model_zoo.get('ocr')
|
||||
assert isinstance(model, VisionEncoderDecoderModel)
|
||||
print(proc)
|
||||
|
||||
test_trocr1()
|
||||
Loading…
Add table
Add a link
Reference in a new issue