* change vector_db_manager.py to handle .mmd * add "conversion" tab * add math mode checkbox in maintab
16 lines
337 B
Python
16 lines
337 B
Python
import subprocess
|
|
|
|
|
|
def pdf_to_mmd(path_input: str):
|
|
"""
|
|
Convert a PDF file to MMD format using the Nougat library
|
|
https://github.com/facebookresearch/nougat
|
|
|
|
stream stderr to the front end
|
|
"""
|
|
output_dir = "../documents/mmds"
|
|
command = ['nougat', path_input, "-o", output_dir]
|
|
subprocess.run(command)
|
|
|
|
|
|
|