写好了ocr_model训练脚本的大致框架

This commit is contained in:
三洋三洋
2024-01-23 04:23:08 +00:00
parent 703ac7441c
commit 9d27ee0585
7 changed files with 106 additions and 0 deletions

View 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

View File