OpenBMB / ToolBench

[ICLR'24 spotlight] An open platform for training, serving, and evaluating large language model for tool learning.
https://openbmb.github.io/ToolBench/
Apache License 2.0
4.83k stars 419 forks source link

AttributeError: 'Namespace' object has no attribute 'max_sequence_length' #188

Open shutter-cp opened 1 year ago

shutter-cp commented 1 year ago

CUDA SETUP: Highest compute capability among GPUs detected: 8.0 CUDA SETUP: Detected CUDA version 111 CUDA SETUP: Loading binary /usr/local/lib/python3.8/dist-packages/bitsandbytes/libbitsandbytes_cuda111.so... Initializing... Loading model... ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ /home/jovyan/chenpeng6-01/ToolBench/toolbench/inference/toolbench_server.py:98 in │ │ │ │ 95 │ │ args = parser.parse_args() │ │ 96 │ │ return args │ │ 97 │ │ ❱ 98 model = Model() │ │ 99 │ │ 100 │ │ 101 @app.route('/stream', methods=['GET', 'POST']) │ │ │ │ /home/jovyan/chenpeng6-01/ToolBench/toolbench/inference/toolbench_server.py:26 in init │ │ │ │ 23 │ │ self.args = self.get_args() │ │ 24 │ │ self.pipeline = pipeline_runner(self.args, add_retrieval=False, server=True) │ │ 25 │ │ print("Loading model...") │ │ ❱ 26 │ │ self.llm = self.pipeline.get_backbone_model() │ │ 27 │ │ print("Model loaded in {} seconds".format(time.time() - starting_time)) │ │ 28 │ │ starting_time = time.time() │ │ 29 │ │ print("Loading retriever...") │ │ │ │ /home/jovyan/chenpeng6-01/ToolBench/toolbench/inference/Downstream_tasks/rapidapi.py:404 in │ │ get_backbone_model │ │ │ │ 401 │ │ args = self.args │ │ 402 │ │ if args.backbone_model == "toolllama": │ │ 403 │ │ │ # ratio = 4 means the sequence length is expanded by 4, remember to change t │ │ ❱ 404 │ │ │ ratio = int(args.max_sequence_length/args.max_source_sequence_length) │ │ 405 │ │ │ replace_llama_with_condense(ratio=ratio) │ │ 406 │ │ │ if args.lora: │ │ 407 │ │ │ │ backbone_model = ToolLLaMALoRA(base_name_or_path=args.modelpath, model │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ AttributeError: 'Namespace' object has no attribute 'max_sequence_length'

python3 toolbench/inference/toolbench_server.py \

--tool_root_dir data/toolenv/tools/ \
--corpus_tsv_path data/retrieval/G1/corpus.tsv \
--retrieved_api_nums 5 \
--backbone_model toolllama \
--model_path /home/jovyan/chenpeng6-01/ToolModel \
--max_observation_length 1024 \
--method DFS_woFilter_w2 \
--input_query_file data/test_instruction/G1_instruction.json \
--output_answer_file toolllama_lora_dfs_open_domain_result \
--rapidapi_key xxxxxxxxxxx
shutter-cp commented 1 year ago

HFValidationError: Repo id must use alphanumeric chars or '-', '_', '.', '--' and '..' are forbidden, '-' and '.' cannot start or end the name, max length is 96: 'your_model_path/'.

miandai commented 1 year ago

Add two lines to toolbench/inference/toolbench_server.py:

parser.add_argument('--max_source_sequence_length', type=int, default=4096, required=False, help='original maximum model sequence length') parser.add_argument('--max_sequence_length', type=int, default=8192, required=False, help='maximum model sequence length')