Add local MedGemma server and validation improvements#6
Open
ambeckley wants to merge 7 commits intoHealthRex-ARISE:mainfrom
Open
Add local MedGemma server and validation improvements#6ambeckley wants to merge 7 commits intoHealthRex-ARISE:mainfrom
ambeckley wants to merge 7 commits intoHealthRex-ARISE:mainfrom
Conversation
- Add [project.optional-dependencies] local-server with fastapi, uvicorn, transformers, torch, accelerate, pillow for scripts/local_model_server.py - Install with: pip install -e '.[local-server]' Co-authored-by: Cursor <cursoragent@cursor.com>
- scripts/local_model_server.py: FastAPI server wrapping Hugging Face MedGemma-27b-it (google/medgemma-27b-it) with MAST-compatible POST / endpoint (Bearer auth, text/plain body, JSON response) - Supports CUDA, Metal (MPS) on Apple Silicon, and CPU; loads model on startup and normalizes JSON (embedding input_ids as long, SCT single-object unwrap, code-block and +number JSON extraction) - scripts/LOCAL_MODEL_SETUP.md: setup and usage for running the local server and validating with validate_all.py Co-authored-by: Cursor <cursoragent@cursor.com>
- Discover both test_*.txt and example_*.txt so SCT benchmark (example_001
through example_005) is run by validate_all.py
- When a benchmark has no test cases, return a result dict with passed=0,
failed=0, total_tests=0 to avoid KeyError in main() and print_benchmark_results
- Use results.get('passed', 0) and results.get('failed', 0) so benchmarks
with no tests do not break the final summary
Co-authored-by: Cursor <cursoragent@cursor.com>
Added SSL verification status output to endpoint info.
Updated model server configuration and endpoints.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scripts/local_model_server.py): FastAPI server wrapping Hugging Face MedGemma-27b-it for running MAST benchmarks locally. Supports CUDA, Metal (MPS) on Apple Silicon, and CPU. Includes JSON response normalization for SCT (single-object unwrap, code-block extraction, invalid+Nnumber fix) and correctinput_idsdtype for embeddings.scripts/LOCAL_MODEL_SETUP.md) for running the server and validating withvalidate_all.py.pyproject.toml):[local-server]extra with fastapi, uvicorn, transformers, torch, accelerate, pillow. Install withpip install -e '.[local-server]'.