Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xturing-0.1.4 BaseModel.create error #213

Closed
xupruvu opened this issue Jun 14, 2023 · 2 comments
Closed

xturing-0.1.4 BaseModel.create error #213

xupruvu opened this issue Jun 14, 2023 · 2 comments

Comments

@xupruvu
Copy link

xupruvu commented Jun 14, 2023

There is no problem when using xturing-0.1.3, but the following error occurs when upgrading to xturing-0.1.4

from xturing.datasets.instruction_dataset import InstructionDataset
from xturing.models.base import BaseModel

instruction_dataset = InstructionDataset("alpaca_data")
model = BaseModel.create("bloom_lora")

It gives an error:

 /home/tl_admin/xturing_test/train.py:5 in <module>                                               │
│                                                                                                  │
│    2 from xturing.models.base import BaseModel                                                   │
│    3                                                                                             │
│    4 instruction_dataset = InstructionDataset("alpaca_data")                                     │
│ ❱  5 model = BaseModel.create("bloom_lora")                                                      │
│    6                                                                                             │
│    7 finetuning_config = model.finetuning_config()                                               │
│    8                                                                                             │
│                                                                                                  │
│ /home/tl_admin/.local/lib/python3.8/site-packages/xturing/registry.py:14 in create               │
│                                                                                                  │
│   11 │                                                                                           │
│   12 │   @classmethod                                                                            │
│   13 │   def create(cls, class_key, *args, **kwargs):                                            │
│ ❱ 14 │   │   return cls.registry[class_key](*args, **kwargs)                                     │
│   15 │                                                                                           │
│   16 │   @classmethod                                                                            │
│   17 │   def __getitem__(cls, key):                                                              │
│                                                                                                  │
│ /home/tl_admin/.local/lib/python3.8/site-packages/xturing/models/bloom.py:28 in __init__         │
│                                                                                                  │
│   25 │   config_name: str = "bloom_lora"                                                         │
│   26 │                                                                                           │
│   27 │   def __init__(self, weights_path: Optional[str] = None):                                 │
│ ❱ 28 │   │   super().__init__(BloomLoraEngine.config_name, weights_path)                         │
│   29                                                                                             │
│   30                                                                                             │
│   31 class BloomInt8(CausalInt8Model):                                                           │
│                                                                                                  │
│ /home/tl_admin/.local/lib/python3.8/site-packages/xturing/models/causal.py:222 in __init__       │
│                                                                                                  │
│   219 │   │   model_name: Optional[str] = None,                                                  │
│   220 │   │   target_modules: Optional[List[str]] = None,                                        │
│   221 │   ):                                                                                     │
│ ❱ 222 │   │   super().__init__(                                                                  │
│   223 │   │   │   engine,                                                                        │
│   224 │   │   │   weights_path=weights_path,                                                     │
│   225 │   │   │   model_name=model_name,                                                         │
│                                                                                                  │
│ /home/tl_admin/.local/lib/python3.8/site-packages/xturing/models/causal.py:34 in __init__        │
│                                                                                                  │
│    31 │   │   model_name: Optional[str] = None,                                                  │
│    32 │   │   target_modules: Optional[List[str]] = None,                                        │
│    33 │   ):                                                                                     │
│ ❱  34 │   │   self.engine = BaseEngine.create(                                                   │
│    35 │   │   │   engine,                                                                        │
│    36 │   │   │   weights_path=weights_path,                                                     │
│    37 │   │   │   model_name=model_name,                                                         │
│                                                                                                  │
│ /home/tl_admin/.local/lib/python3.8/site-packages/xturing/registry.py:14 in create               │
│                                                                                                  │
│   11 │                                                                                           │
│   12 │   @classmethod                                                                            │
│   13 │   def create(cls, class_key, *args, **kwargs):                                            │
│ ❱ 14 │   │   return cls.registry[class_key](*args, **kwargs)                                     │
│   15 │                                                                                           │
│   16 │   @classmethod                                                                            │
│   17 │   def __getitem__(cls, key):                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: __init__() got an unexpected keyword argument 'model_name'
@StochasticRomanAgeev
Copy link
Contributor

StochasticRomanAgeev commented Jun 14, 2023

Hi @xupruvu,
Please use direct import for bloom loading

model = BloomLora()

We will also fix this issue in next release

tushar2407 added a commit to tushar2407/xturing that referenced this issue Jun 14, 2023
edited the CausalModel for parameters
StochasticRomanAgeev added a commit that referenced this issue Jun 14, 2023
@StochasticRomanAgeev
Copy link
Contributor

Hi again, @xupruvu
Release is now in main branch, thanks for feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants