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

Refactor #91

Merged
merged 4 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions dbgpt_hub/configs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from .model_args import (
ModelArguments,
TrainingArguments,
ModelInferenceArguments,
)
from .data_args import(
DataArguments,
Expand All @@ -13,5 +12,4 @@
"Llama2Template",
"ModelArguments",
"TrainingArguments",
"ModelInferenceArguments",
]
10 changes: 3 additions & 7 deletions dbgpt_hub/configs/data_args.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import os
import json
from typing import List, Literal, Optional
from dataclasses import dataclass, field
import tiktoken
from dataclasses import dataclass
from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Union

# from dbgpt_hub.llm_base.loggings import get_logger

from dataclasses import dataclass, field
from typing import TYPE_CHECKING, Dict, List, Literal, Optional, Tuple, Union
if TYPE_CHECKING:
from transformers import PreTrainedTokenizer


DEFAULT_PROMPT_DICT = {
"prompt_input": ("{instruction}\n\n{input}\n\n"),
"prompt_no_input": ("{instruction}\n\n"),
Expand Down
28 changes: 1 addition & 27 deletions dbgpt_hub/configs/model_args.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import json
import os
import yaml
import torch
from dataclasses import dataclass, field, asdict
from typing import Optional, Any, Dict, List,Literal
from typing import Optional, Any, Dict,Literal
from transformers import Seq2SeqTrainingArguments
from dbgpt_hub.configs.config import (
MODEL_PATH,
DEFAULT_FT_MODEL_NAME,
DATA_PATH,
ADAPTER_PATH,
)

Expand Down Expand Up @@ -118,28 +114,6 @@ def __post_init__(self):
HfFolder.save_token(self.hf_auth_token)


@dataclass
class ModelInferenceArguments:
cache_dir: Optional[str] = field(default=None)
model_name_or_path: Optional[str] = field(
default=MODEL_PATH, metadata={"help": "Path to pre-trained model"}
)
model_max_length: int = field(
default=1024,
metadata={
"help": "Maximum sequence length. Sequences will be right padded (and possibly truncated)."
},
)
prompt_template: str = field(
default="default",
metadata={
"help": "Prompt template name. Such as vanilla, alpaca, llama2, vicuna..., etc."
},
)
source_prefix: Optional[str] = field(
default=None, metadata={"help": "Prefix to prepend to every source text."}
)



@dataclass
Expand Down
Loading