Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
[NeuralChat] Support Mixtral-8x7B-v0.1 model (#972)
Browse files Browse the repository at this point in the history
* Support Mixstral-8x7b model

Signed-off-by: lvliang-intel <liang1.lv@intel.com>
  • Loading branch information
lvliang-intel authored Dec 25, 2023
1 parent 1a2afa9 commit 9729b6a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions intel_extension_for_transformers/neural_chat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ The table below displays the validated model list in NeuralChat for both inferen
|LLaMA2 series|||||
|MPT series|||||
|Mistral|||||
|Mixtral-8x7b-v0.1|||||
|ChatGLM series|||||
|Qwen series|||||
|StarCoder series| | | ||
Expand Down
3 changes: 2 additions & 1 deletion intel_extension_for_transformers/neural_chat/chatbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ def build_chatbot(config: PipelineConfig=None):
"bloom" in config.model_name_or_path.lower() or \
"starcoder" in config.model_name_or_path.lower() or \
"codegen" in config.model_name_or_path.lower() or \
"magicoder" in config.model_name_or_path.lower():
"magicoder" in config.model_name_or_path.lower() or \
"mixtral" in config.model_name_or_path.lower():
from .models.base_model import BaseModel
adapter = BaseModel()
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ def load_model(
or config.model_type == "mpt"
or config.model_type == "llama"
or config.model_type == "mistral"
or config.model_type == "mixtral"
) and not ipex_int8) or config.model_type == "opt":
with smart_context_manager(use_deepspeed=use_deepspeed):
model = AutoModelForCausalLM.from_pretrained(
Expand Down Expand Up @@ -554,7 +555,7 @@ def load_model(
)
else:
raise ValueError(f"unsupported model name or path {model_name}, \
only supports FLAN-T5/LLAMA/MPT/GPT/BLOOM/OPT/QWEN/NEURAL-CHAT/MISTRAL/CODELLAMA/STARCODER/CODEGEN now.")
only supports t5/llama/mpt/gptj/bloom/opt/qwen/mistral/mixtral/gpt_bigcode model type now.")
except EnvironmentError as e:
logging.error(f"Exception: {e}")
if "not a local folder and is not a valid model identifier" in str(e):
Expand Down

0 comments on commit 9729b6a

Please sign in to comment.