| |
| |
|
|
| from onescience.models.protenix.config.extend_types import ( |
| DefaultNoneWithType, |
| GlobalConfigValue, |
| ListValue, |
| RequiredValue, |
| ValueMaybeNone, |
| ) |
|
|
| basic_configs = { |
| "project": "MedGemma", |
| "run_name": RequiredValue(str), |
| "base_dir": RequiredValue(str), |
| "seed": 42, |
| "deterministic": False, |
| "use_wandb": False, |
| "load_checkpoint_path": "", |
| "eval_only": True, |
| } |
|
|
| model_configs = { |
| |
| "variant": RequiredValue(str), |
| "model_path": RequiredValue(str), |
| "tokenizer_path": DefaultNoneWithType(str), |
| "prompt_format": "chat", |
| "is_multimodal": True, |
| } |
|
|
| inference_configs = { |
| |
| "gpu_memory_utilization": 0.9, |
| "max_model_len": DefaultNoneWithType(int), |
| "tensor_parallel_size": 1, |
| "default_max_tokens": 500, |
| "temperature": 0.7, |
| "top_p": 0.9, |
| "top_k": DefaultNoneWithType(int), |
| "min_p": DefaultNoneWithType(float), |
| "batch_size": 1, |
| "num_workers": 0, |
| "use_vllm": True, |
| } |
|
|
| data_configs = { |
| |
| "input_json_path": DefaultNoneWithType(str), |
| "input_dir": DefaultNoneWithType(str), |
| "image_input_width": 224, |
| "image_input_height": 224, |
| "max_parallel_download_workers": 4, |
| "worker_download_parallelism": "THREAD", |
| "use_msa": False, |
| } |
|
|
| output_configs = { |
| |
| "dump_dir": RequiredValue(str), |
| "save_predictions": True, |
| "output_format": "json", |
| "save_intermediate": False, |
| } |
|
|
| |
| medgemma_base_configs = { |
| **basic_configs, |
| "model": model_configs, |
| "inference": inference_configs, |
| "data": data_configs, |
| "output": output_configs, |
| } |
|
|