* add conversion from pdf to latex-like (.mmd) format with nougat
* change vector_db_manager.py to handle .mmd * add "conversion" tab * add math mode checkbox in maintab
This commit is contained in:
parent
356f72fedc
commit
11b92baaa8
17 changed files with 247 additions and 33 deletions
16
backend/pdf_to_mmd.py
Normal file
16
backend/pdf_to_mmd.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
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)
|
||||
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue