MCPcopy Create free account
hub / github.com/Paper2Poster/Paper2Poster / compute_interleaved_ppl

Function compute_interleaved_ppl

utils/poster_eval_utils.py:139–149  ·  view source on GitHub ↗
(paper_name, poster_method)

Source from the content-addressed store, hash-verified

137 return math.exp(-total_lp / n_text)
138
139def compute_interleaved_ppl(paper_name, poster_method):
140 base_dir = f'eval_poster_markdown/{paper_name}/{poster_method}'
141 with open(os.path.join(base_dir, f'{paper_name}-with-image-refs.md'), 'r') as f:
142 md = f.read()
143 parts = md_to_blocks(md, base_dir)
144 while True:
145 try:
146 return compute_vlm_ppl(parts)
147 except:
148 parts = parts[:-1]
149 continue
150
151
152def get_visual_ppl(image, text):

Callers 1

Calls 2

md_to_blocksFunction · 0.70
compute_vlm_pplFunction · 0.70

Tested by

no test coverage detected