コード例 #1
0
ファイル: app.py プロジェクト: awesome-archive/allennlp-demo
                        type=int,
                        default=128,
                        help="how many results to keep in memory")
    parser.add_argument(
        '--models-file',
        type=str,
        default='models.json',
        help="json file containing the details of the models to load")

    models_group = parser.add_mutually_exclusive_group()
    models_group.add_argument('--model',
                              type=str,
                              action='append',
                              default=[],
                              help='if specified, only load these models')
    models_group.add_argument('--no-models',
                              dest='no_models',
                              action='store_true',
                              help='start just the front-end with no models')

    args = parser.parse_args()

    models = load_demo_models(args.models_file,
                              args.model,
                              model_names_only=args.no_models)

    main(demo_dir=args.demo_dir,
         port=args.port,
         cache_size=args.cache_size,
         models=models)
コード例 #2
0
        type=int,
        default=500,
        help="how many interpretation results to keep in memory")
    parser.add_argument('--attack-cache-size',
                        type=int,
                        default=500,
                        help="how many attack results to keep in memory")
    parser.add_argument(
        '--models-file',
        type=str,
        default='models.json',
        help="json file containing the details of the models to load")

    models_group = parser.add_mutually_exclusive_group()
    models_group.add_argument('--model',
                              type=str,
                              action='append',
                              default=[],
                              help='if specified, only load these models')

    args = parser.parse_args()

    models = load_demo_models(args.models_file, args.model)

    main(demo_dir=args.demo_dir,
         port=args.port,
         cache_size=args.cache_size,
         interpret_cache_size=args.interpret_cache_size,
         attack_cache_size=args.attack_cache_size,
         models=models)