Skip to content

Commit

Permalink
Improving help and info
Browse files Browse the repository at this point in the history
  • Loading branch information
airaria committed May 6, 2023
1 parent a11ef25 commit 08d2ee2
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions scripts/inference_hf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
parser.add_argument('--base_model', default=None, type=str, required=True)
parser.add_argument('--lora_model', default=None, type=str,help="If None, perform inference on the base model")
parser.add_argument('--tokenizer_path',default=None,type=str)
parser.add_argument('--data_file',default=None, type=str,help="file that contains instructions (one instruction per line).")
parser.add_argument('--with_prompt',action='store_true')
parser.add_argument('--interactive',action='store_true')
parser.add_argument('--data_file',default=None, type=str,help="A file that contains instructions (one instruction per line)")
parser.add_argument('--with_prompt',action='store_true',help="wrap the input with the prompt automatically")
parser.add_argument('--interactive',action='store_true',help="run in the instruction mode (single-turn)")
parser.add_argument('--predictions_file', default='./predictions.json', type=str)
args = parser.parse_args()

Expand Down Expand Up @@ -91,7 +91,16 @@ def generate_prompt(instruction, input=None):

with torch.no_grad():
if args.interactive:
print("Start inference with interactive mode.")
print("Start inference with instruction mode.")

print('='*85)
print("+ 该模式下仅支持单轮问答,无多轮对话能力。\n"
"+ 如要进行多轮对话,请使用llama.cpp或llamachat工具。")
print('-'*85)
print("+ This mode only supports single-turn QA.\n"
"+ If you want to experience multi-turn dialogue, please use llama.cpp or llamachat.")
print('='*85)

while True:
raw_input_text = input("Input:")
if len(raw_input_text.strip())==0:
Expand Down

0 comments on commit 08d2ee2

Please sign in to comment.