Remove not-imported MistralConfig (#10670)

This commit is contained in:
Xiangyu Tian 2024-04-07 10:32:05 +08:00 committed by GitHub
parent 1a9b8204a4
commit 08018a18df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -318,15 +318,6 @@ def _get_and_verify_max_len(
def get_config(model: str, def get_config(model: str,
trust_remote_code: bool, trust_remote_code: bool,
revision: Optional[str] = None) -> PretrainedConfig: revision: Optional[str] = None) -> PretrainedConfig:
# NOTE: Because the Mistral model in HF hub does not have
# `configuration_mistral.py`, we cannot use `AutoConfig` to load the
# config. Instead, we use `MistralConfig` directly.
# NOTE: This is a hack. This does not work for local models.
# FIXME: Remove this once the Mistral model is available in the stable
# version of HF transformers.
if "mistral" in model.lower():
return MistralConfig.from_pretrained(model, revision=revision)
try: try:
config = AutoConfig.from_pretrained( config = AutoConfig.from_pretrained(
model, trust_remote_code=trust_remote_code, revision=revision) model, trust_remote_code=trust_remote_code, revision=revision)