Fix get_token
This commit is contained in:
parent
5dcc0cd613
commit
ac1c0fbaed
3 changed files with 18 additions and 3 deletions
|
|
@ -61,7 +61,12 @@ from bitsandbytes.nn import Linear4bit as Bnb_Linear4bit
|
|||
from peft.tuners.lora import Linear4bit as Peft_Linear4bit
|
||||
from ..save import patch_saving_functions
|
||||
import re, os, inspect, math, sys
|
||||
from huggingface_hub.utils._token import get_token
|
||||
try:
|
||||
from huggingface_hub.utils import get_token
|
||||
except:
|
||||
# Old HF Hub versions <= 0.0.25
|
||||
from huggingface_hub.utils._token import get_token
|
||||
pass
|
||||
|
||||
|
||||
def original_apply_qkv(self, X):
|
||||
|
|
|
|||
|
|
@ -22,7 +22,12 @@ from transformers import __version__ as transformers_version
|
|||
from peft import PeftConfig, PeftModel
|
||||
from .mapper import INT_TO_FLOAT_MAPPER, FLOAT_TO_INT_MAPPER, MAP_TO_UNSLOTH_16bit
|
||||
import os
|
||||
from huggingface_hub.utils._token import get_token
|
||||
try:
|
||||
from huggingface_hub.utils import get_token
|
||||
except:
|
||||
# Old HF Hub versions <= 0.0.25
|
||||
from huggingface_hub.utils._token import get_token
|
||||
pass
|
||||
from huggingface_hub import HfFileSystem
|
||||
|
||||
# https://github.com/huggingface/transformers/pull/26037 allows 4 bit loading!
|
||||
|
|
|
|||
|
|
@ -29,7 +29,12 @@ import re
|
|||
from transformers.models.llama.modeling_llama import logger
|
||||
from .tokenizer_utils import fix_sentencepiece_gguf
|
||||
from huggingface_hub import HfApi
|
||||
from huggingface_hub.utils._token import get_token
|
||||
try:
|
||||
from huggingface_hub.utils import get_token
|
||||
except:
|
||||
# Old HF Hub versions <= 0.0.25
|
||||
from huggingface_hub.utils._token import get_token
|
||||
pass
|
||||
from pathlib import Path
|
||||
|
||||
__all__ = [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue