Unverified Commit 586e81a2 authored by vikram singh shekhawat's avatar vikram singh shekhawat Committed by GitHub
Browse files

[Test] Initialize mem_fraction_static in setUpClass to fix pytest VLM test crashes. (#10859)


Co-authored-by: default avatarsvc_repro_tool <svc_repro_tool@habana.ai>
parent fad7ca73
...@@ -27,6 +27,8 @@ MODELS = [ ...@@ -27,6 +27,8 @@ MODELS = [
SimpleNamespace(model="openbmb/MiniCPM-V-2_6", mmmu_accuracy=0.4), SimpleNamespace(model="openbmb/MiniCPM-V-2_6", mmmu_accuracy=0.4),
] ]
#Set default mem_fraction_static to 0.8
DEFAULT_MEM_FRACTION_STATIC = 0.8
class TestVLMModels(CustomTestCase): class TestVLMModels(CustomTestCase):
parsed_args = None # Class variable to store args parsed_args = None # Class variable to store args
...@@ -38,6 +40,9 @@ class TestVLMModels(CustomTestCase): ...@@ -38,6 +40,9 @@ class TestVLMModels(CustomTestCase):
cls.api_key = "sk-123456" cls.api_key = "sk-123456"
cls.time_out = DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH cls.time_out = DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH
if cls.parsed_args is None:
cls.parsed_args = SimpleNamespace(mem_fraction_static=DEFAULT_MEM_FRACTION_STATIC)
# Set OpenAI API key and base URL environment variables. Needed for lmm-evals to work. # Set OpenAI API key and base URL environment variables. Needed for lmm-evals to work.
os.environ["OPENAI_API_KEY"] = cls.api_key os.environ["OPENAI_API_KEY"] = cls.api_key
os.environ["OPENAI_API_BASE"] = f"{cls.base_url}/v1" os.environ["OPENAI_API_BASE"] = f"{cls.base_url}/v1"
...@@ -302,7 +307,7 @@ if __name__ == "__main__": ...@@ -302,7 +307,7 @@ if __name__ == "__main__":
"--mem-fraction-static", "--mem-fraction-static",
type=float, type=float,
help="Static memory fraction for the model", help="Static memory fraction for the model",
default=0.8, default=DEFAULT_MEM_FRACTION_STATIC,
) )
# Parse args intended for unittest # Parse args intended for unittest
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment