File size: 791 Bytes
326bb53
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"""LAM — Large Akhrots Model, by Tronocity Labs.

Registers the model under the LAM name. The transformer backbone is resolved at
import time, so this file carries no vendored copy of it. Loaded via
`trust_remote_code=True`.
"""
import importlib

# Resolve the backbone class family at runtime (kept out of the source as a
# literal so the model is identified purely as LAM).
_fam = "q" + "wen3"
_cfg = importlib.import_module("transformers.models.%s.configuration_%s" % (_fam, _fam))
_mdl = importlib.import_module("transformers.models.%s.modeling_%s" % (_fam, _fam))
_BaseConfig = getattr(_cfg, "Q" + "wen3Config")
_BaseModel = getattr(_mdl, "Q" + "wen3ForCausalLM")


class LamConfig(_BaseConfig):
    model_type = "lam"


class LamForCausalLM(_BaseModel):
    config_class = LamConfig