Skip to content

Commit

Permalink
feat(gguf): apply fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
g-prz committed Sep 18, 2024
1 parent 94d8fc7 commit d28372e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/transformers/modeling_gguf_pytorch_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import re
from typing import Optional

import numpy as np
import re
from tqdm import tqdm

from .integrations import (
Expand Down Expand Up @@ -105,7 +105,9 @@ def load_gguf_checkpoint(gguf_checkpoint_path, return_tensors=False):
gguf_file_name = gguf_checkpoint_path.split("/")[-1].lower()
m = re.search(r"-\d+b-", gguf_file_name)
if m is None:
raise ValueError(f"From file name, cannot determine the number of parameters for {architecture} architecture")
raise ValueError(
f"From file name, cannot determine the number of parameters for {architecture} architecture"
)
model_size = m.group().strip("-")

if architecture + model_size not in GGUF_SUPPORTED_ARCHITECTURES:
Expand Down
2 changes: 1 addition & 1 deletion tests/quantization/ggml/test_ggml.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class GgufIntegrationTests(unittest.TestCase):

q2_k_falcon7b_model_id = "tiiuae-falcon-7b-Q2_K.gguf"
q2_k_falcon40b_model_id = "falcon-40b-Q2_K.gguf"

example_text = "Hello"

def test_q2_k(self):
Expand Down

0 comments on commit d28372e

Please sign in to comment.