Skip to content

Add Nayana OCR, layout detection and Gemma-judged VQA - #9

Open
adithya-s-k wants to merge 14 commits into
mainfrom
codex/multilingual-ocr
Open

adithya-s-k wants to merge 14 commits into
mainfrom
codex/multilingual-ocr

Conversation

@adithya-s-k

@adithya-s-k adithya-s-k commented Sep 15, 2026

Copy link
Copy Markdown
Owner

Adds experiment 05 with one OpenEnv environment for full-page OCR, section OCR, six-class layout detection, multiple-choice VQA, and descriptive VQA. The Gradio playground provides indexed navigation, scoring, reference reveal, and layout overlays.

The pinned 22-language Nayana corpus is served from the HuggingEnvs bucket. Per-language indexes provide stable task IDs and document-disjoint splits; bounded caches, physical-block sampling, and prefetch support local, Space, and HF Jobs access. Descriptive answers use strict Gemma grading through HF Inference Providers with DeepInfra; provider failures return errors without assigning rewards.

Includes the installable environment, Docker deployment, TRL GRPO runner, HF Jobs launchers, notebook, regression tests, and setup/reproduction documentation. The published corpus manifest is the only committed data artifact. Generated reports and checkpoints use ignored artifacts/; CI publishes its verification reports as workflow artifacts.

Validation: 55 regression tests passed from a clean export, along with HTTP/WebSocket/media smoke, lint, and repository index checks. The deployed environment also passed multilingual UI, notebook, and live judge calibration checks.

GPU optimizer training remains unverified. The 50-million-pixel image limit rejects some indexed candidates; unattended full-corpus runs need a versioned resize or eligibility policy. Source and derived data retain CognitiveLab attribution and CC BY-NC 4.0; code is Apache-2.0.

@adithya-s-k
adithya-s-k marked this pull request as ready for review September 15, 2026 14:50
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 15, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-15T14:56:22.307274Z 8f6df0a Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8f6df0a742

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +159 to +160
with self.index_cache.lease(info["sha256"], download) as path:
with self._connection(path) as db:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Revalidate cached index files before opening them

When an index has already been downloaded, DiskCache.lease() takes the hit path and never invokes download, so the size and SHA-256 checks above are skipped. If the persistent cache is corrupted or modified between server runs, _connection can therefore open a valid-but-altered SQLite database under the original snapshot ID and silently serve different task mappings. Verify the cached file against info["sha256"] before opening it, as the local-index path already does.

Useful? React with 👍 / 👎.

Comment on lines +42 to +47
storage = json.loads(manifest.read_text()).get("storage")
env[
"NAYANA_CORPUS_MANIFEST"
if storage == "bucket-parquet"
else "NAYANA_SNAPSHOT"
] = str(path)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Pass the snapshot directory when given a small manifest file

When snapshot is a small prepared snapshot's manifest.json, this branch correctly reads that file to detect its storage type but then assigns the file itself to NAYANA_SNAPSHOT. The child process passes that value to Catalog, which treats it as a directory and attempts to read <manifest.json>/manifest.json, so nayana-smoke --snapshot /path/to/manifest.json cannot start even though both this helper and the smoke command explicitly handle file-valued snapshots. Assign manifest.parent for the non-corpus case.

Useful? React with 👍 / 👎.

@adithya-s-k adithya-s-k changed the title Add full-corpus multilingual OCR with indexed bucket access Add Nayana OCR, layout detection and Gemma-judged VQA Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant