def METHOD_NAME():
    document_store = FAISSDocumentStore(
        embedding_dim=args.embedding_dim,
        duplicate_documents="skip",
        return_embedding=True,
        faiss_index_factory_str="Flat",
    )
    use_gpu = True if args.device == "gpu" else False
    retriever = DensePassageRetriever(
        document_store=document_store,
        query_embedding_model=args.query_embedding_model,
        passage_embedding_model=args.passage_embedding_model,
        params_path=args.params_path,
        output_emb_size=args.embedding_dim if args.model_type in ["ernie_search", "neural_search"] else None,
        max_seq_len_query=args.max_seq_len_query,
        max_seq_len_passage=args.max_seq_len_passage,
        batch_size=args.retriever_batch_size,
        use_gpu=use_gpu,
        embed_title=args.embed_title,
    )
    # Indexing Markdowns
    if args.title_split is True:
        markdown_converter = MarkdownRawTextConverter()
        headers_to_split_on = [
            ("#", "Header 1"),
            ("##", "Header 2"),
            ("###", "Header 3"),
            ("####", "Header 4"),
            ("#####", "Header 5"),
            ("######", "Header 6"),
        ]
        text_splitter = MarkdownHeaderTextSplitter(
            separator="\n",
            chunk_size=args.chunk_size,
            headers_to_split_on=headers_to_split_on,
            return_each_line=False,
            filters=["\n"],
        )
    else:
        markdown_converter = MarkdownConverter()
        text_splitter = CharacterTextSplitter(
            separator="\n", chunk_size=args.chunk_size, chunk_overlap=0, filters=["\n"]
        )
    if args.indexing:
        indexing_pipeline = Pipeline()
        indexing_pipeline.add_node(component=markdown_converter, name="MarkdownConverter", inputs=["File"])
        indexing_pipeline.add_node(component=text_splitter, name="Splitter", inputs=["MarkdownConverter"])
        indexing_pipeline.add_node(component=retriever, name="Retriever", inputs=["Splitter"])
        indexing_pipeline.add_node(component=document_store, name="DocumentStore", inputs=["Retriever"])
        files = glob.glob(args.file_paths + "/**/*.md", recursive=True)
        indexing_pipeline.run(file_paths=files)
    # Query Markdowns
    ernie_bot = ErnieBot(api_key=args.api_key, secret_key=args.secret_key)
    ranker = ErnieRanker(model_name_or_path="rocketqa-zh-dureader-cross-encoder", use_gpu=use_gpu)
    query_pipeline = Pipeline()
    query_pipeline.add_node(component=retriever, name="Retriever", inputs=["Query"])
    query_pipeline.add_node(component=ranker, name="Ranker", inputs=["Retriever"])
    query_pipeline.add_node(component=PromptTemplate("背景：{documents} 问题：{query}"), name="Template", inputs=["Ranker"])
    query_pipeline.add_node(
        component=TruncatedConversationHistory(max_length=256), name="TruncateHistory", inputs=["Template"]
    )
    query_pipeline.add_node(component=ernie_bot, name="ErnieBot", inputs=["TruncateHistory"])
    query = "Jupyter 和 AI Studio Notebook 有什么区别？如何使用Jupyter？"
    start_time = time.time()
    prediction = query_pipeline.run(query=query, params={"Retriever": {"top_k": 30}, "Ranker": {"top_k": 3}})
    end_time = time.time()
    print("Time cost for query markdown conversion:", end_time - start_time)
    print("user: {}".format(query))
    print("assistant: {}".format(prediction["result"]))