You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

config.py 2.8 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # Copyright 2021 Huawei Technologies Co., Ltd
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. # ============================================================================
  15. """
  16. Retriever Config.
  17. """
  18. import argparse
  19. def ThinkRetrieverConfig():
  20. """retriever config"""
  21. parser = argparse.ArgumentParser()
  22. parser.add_argument("--q_len", type=int, default=64, help="max query len")
  23. parser.add_argument("--d_len", type=int, default=192, help="max doc len")
  24. parser.add_argument("--s_len", type=int, default=448, help="max seq len")
  25. parser.add_argument("--in_len", type=int, default=768, help="in len")
  26. parser.add_argument("--out_len", type=int, default=1, help="out len")
  27. parser.add_argument("--num_docs", type=int, default=500, help="docs num")
  28. parser.add_argument("--topk", type=int, default=8, help="top num")
  29. parser.add_argument("--onehop_num", type=int, default=8, help="onehop num")
  30. parser.add_argument("--batch_size", type=int, default=1, help="batch size")
  31. parser.add_argument("--device_num", type=int, default=8, help="device num")
  32. parser.add_argument("--save_name", type=str, default='doc_path', help='name of output')
  33. parser.add_argument("--save_path", type=str, default='../', help='path of output')
  34. parser.add_argument("--vocab_path", type=str, default='../vocab.txt', help="vocab path")
  35. parser.add_argument("--wiki_path", type=str, default='../db_docs_bidirection_new.pkl', help="wiki path")
  36. parser.add_argument("--dev_path", type=str, default='../hotpot_dev_fullwiki_v1_for_retriever.json',
  37. help="dev path")
  38. parser.add_argument("--dev_data_path", type=str, default='../dev_tf_idf_data_raw.pkl', help="dev data path")
  39. parser.add_argument("--onehop_bert_path", type=str, default='../onehop.ckpt', help="onehop bert ckpt path")
  40. parser.add_argument("--onehop_mlp_path", type=str, default='../onehop_mlp.ckpt', help="onehop mlp ckpt path")
  41. parser.add_argument("--twohop_bert_path", type=str, default='../twohop.ckpt', help="twohop bert ckpt path")
  42. parser.add_argument("--twohop_mlp_path", type=str, default='../twohop_mlp.ckpt', help="twohop mlp ckpt path")
  43. parser.add_argument("--q_path", type=str, default="../queries", help="queries data path")
  44. return parser.parse_args()