Skip to content

Instantly share code, notes, and snippets.

Error in user YAML: (<unknown>): mapping values are not allowed in this context at line 2 column 430
---
name: TranscribePNGFolder
description: Use this skill whenever the user wants to transcribe PDF contents, contained in PNG files in a local folder, into text or markdown. The source PDFs include academic papers, reports, manuals, or any PDF with mixed text and figures. The skill iterates over the PNG files, uses a vision model to transcribe the text and describe any figures in place, collating everything into a single clean markdown document. Triggers: "transcribe this PDF in directory", "extract text from PDF", "convert PDF contained in directory to markdown", "summarise this PDF" (as a first step).
---

TranscribePNGFolder Skill

Overview

Transcribes PDF contents from PNG to a markdown document by:

data_structure
#
loop_
_atom_site.group_PDB
_atom_site.type_symbol
_atom_site.label_atom_id
_atom_site.label_alt_id
_atom_site.label_comp_id
_atom_site.label_asym_id
_atom_site.label_entity_id
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import pandas as pd
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem import rdMolDescriptors
from rdkit.Chem import AllChem, rdMolDescriptors, rdMolAlign, rdMolTransforms
import numpy as np
from tqdm.notebook import tqdm
import modal
image = (
modal.Image.micromamba(python_version="3.10")
.apt_install('gcc')
.apt_install('git', 'wget')
.micromamba_install('openmm==8.0.0', 'pdbfixer','kalign2=2.04', 'hhsuite=3.3.0',
'mmseqs2', channels=['conda-forge', 'bioconda'])
.run_commands('pip install "colabfold[alphafold-minus-jax] @ git+https://github.com/sokrypton/ColabFold"')
.run_commands('pip install "colabfold[alphafold]"')
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import modal
image = (
modal.Image.debian_slim()
.pip_install("uv")
.run_commands("uv pip install --system --compile-bytecode chai_lab==0.4.2")
.run_commands('mkdir -p /usr/local/lib/python3.11/site-packages/downloads/models_v2')
.apt_install("wget")
.run_commands('wget -O /usr/local/lib/python3.11/site-packages/downloads/conformers_v1.apkl https://chaiassets.com/chai1-inference-depencencies/conformers_v1.apkl')
.run_commands('wget -O /usr/local/lib/python3.11/site-packages/downloads/models_v2/trunk.pt https://chaiassets.com/chai1-inference-depencencies/models_v2/trunk.pt')
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.