写好了ocr_model训练脚本的大致框架
This commit is contained in:
28
src/models/ocr_model/utils/get.py
Normal file
28
src/models/ocr_model/utils/get.py
Normal file
@@ -0,0 +1,28 @@
|
||||
from ....globals import VOCAB_SIZE
|
||||
from typing import (
|
||||
Tuple
|
||||
)
|
||||
|
||||
from transformers import (
|
||||
RobertaConfig,
|
||||
RobertaModel,
|
||||
RobertaTokenizerFast
|
||||
)
|
||||
|
||||
|
||||
def get_encoder():
|
||||
...
|
||||
|
||||
|
||||
def get_tokenizer() -> RobertaTokenizerFast:
|
||||
...
|
||||
|
||||
|
||||
def get_decoder() -> RobertaModel:
|
||||
configuration = RobertaConfig(
|
||||
vocab_size=VOCAB_SIZE,
|
||||
is_decoder=True
|
||||
)
|
||||
model = RobertaModel(configuration)
|
||||
return model
|
||||
|
||||
0
src/models/ocr_model/utils/transforms.py
Normal file
0
src/models/ocr_model/utils/transforms.py
Normal file
Reference in New Issue
Block a user