from pdf_craft import PDFPageExtractor, MarkDownWriter
extractor = PDFPageExtractor( device="cpu",# If you want to use CUDA, please change to device="cuda:0" format. model_dir_path="/path/to/model/dir/path",# The folder address where the AI model is downloaded and installed ) with MarkDownWriter(markdown_path,"images","utf-8") as md: forblockinextractor.extract(pdf="/path/to/pdf/file"): md.write(block)
extractor = PDFPageExtractor( device="cpu",# If you want to use CUDA, please change to device="cuda:0" format. model_dir_path="/path/to/model/dir/path",# The folder address where the AI model is downloaded and installed )
将抽取的内容送给LLM,生成EPUB文件
from pdf_craft import analyse from pdf_craft import LLM