Skip to content

Commit

Permalink
Merge pull request #91 from eosphoros-ai/refactor
Browse files Browse the repository at this point in the history
Refactor
  • Loading branch information
Jian1273 authored Oct 10, 2023
2 parents 0d5ae50 + a2128db commit fbb8513
Show file tree
Hide file tree
Showing 13 changed files with 45 additions and 852 deletions.
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

0 comments on commit fbb8513

Please sign in to comment.