From c765db5cf658b210ef93b34917aae92c9635c747 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Sun, 6 Apr 2025 01:43:42 -0700 Subject: [PATCH] Llama4 --- unsloth/models/llama4.py | 16 ++++++++++++++++ unsloth/models/mapper.py | 10 ++++++++++ 2 files changed, 26 insertions(+) create mode 100644 unsloth/models/llama4.py diff --git a/unsloth/models/llama4.py b/unsloth/models/llama4.py new file mode 100644 index 0000000000..9818b3db04 --- /dev/null +++ b/unsloth/models/llama4.py @@ -0,0 +1,16 @@ +# Copyright 2023-present Daniel Han-Chen & the Unsloth team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from unsloth_studio.models import patch_llama4 +patch_llama4() diff --git a/unsloth/models/mapper.py b/unsloth/models/mapper.py index 91ed262502..b8128968c9 100644 --- a/unsloth/models/mapper.py +++ b/unsloth/models/mapper.py @@ -738,6 +738,16 @@ __INT_TO_FLOAT_MAPPER = \ "canopylabs/orpheus-3b-0.1-ft", "unsloth/orpheus-3b-0.1-ft-bnb-4bit", ), + "unsloth/Llama-4-Scout-17B-16E-Instruct-unsloth-dynamic-bnb-4bit" : ( + "unsloth/Llama-4-Scout-17B-16E-Instruct-unsloth", + "meta-llama/Llama-4-Scout-17B-16E-Instruct", + "unsloth/Llama-4-Scout-17B-16E-Instruct-unsloth-bnb-4bit", + ), + "unsloth/Llama-4-Scout-17B-16E-unsloth-dynamic-bnb-4bit" : ( + "unsloth/Llama-4-Scout-17B-16E-unsloth", + "meta-llama/Llama-4-Scout-17B-16E", + "unsloth/Llama-4-Scout-17B-16E-unsloth-bnb-4bit", + ), } INT_TO_FLOAT_MAPPER = {}