-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from eosphoros-ai/generate
Updated the predict method and modified the code
- Loading branch information
Showing
12 changed files
with
140 additions
and
266 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
from .data_args import DataArguments | ||
from .gen_args import GenerationArguments | ||
from .infer_args import ModelInferenceArguments | ||
from .lora_args import LoraArguments | ||
from .model_args import ModelArguments | ||
from .quant_args import QuantArguments | ||
from .train_args import TrainingArguments | ||
|
||
__all__ = [ | ||
'DataArguments', 'GenerationArguments', 'ModelArguments', | ||
'TrainingArguments', 'LoraArguments','QuantArguments' | ||
] | ||
'TrainingArguments', 'ModelInferenceArguments', 'LoraArguments', | ||
'QuantArguments' | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from dataclasses import dataclass, field | ||
from typing import Optional | ||
import os | ||
|
||
model_path = os.path.join("./model", os.listdir("model")[1]) | ||
|
||
@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.'}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.