"sgl-kernel/git@developer.sourcefind.cn:change/sglang.git" did not exist on "51ac297ace2256a77a80ee39ebecc28d23d44567"
Commit 386e86e2 authored by Rémi Louf's avatar Rémi Louf
Browse files

raise exception when class initialized with __init__

parent 4446c02b
......@@ -17,11 +17,13 @@
class Seq2SeqModel(object):
def __init__(self):
# need to use from_pretrained to initialize
raise NotImplementedError
raise EnvironmentError(
"""Seq2Seq is designed to be instantiated using the
`Seq2Seq.from_pretrained(encoder_name_or_path, decoder_name_or_path)` method."""
)
@classmethod
def from_pretrained(cls, encoder, decoder):
def from_pretrained(cls, encoder_name, decoder_name):
# Here we should call AutoModel to initialize the models depending
# on the pretrained models taken as an input.
# For a first iteration we only work with Bert.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment