@@ -18,7 +18,7 @@ def setup_and_teardown(self, request):
1818 @pytest .mark .parametrize ("model_url" , repo_branches )
1919 @pytest .mark .asyncio
2020 async def test_models_on_cortexso_hub (self , model_url ):
21-
21+ print ( "Pull model from cortexso hub" )
2222 # Pull model from cortexso hub
2323 json_body = {
2424 "model" : model_url
@@ -28,6 +28,7 @@ async def test_models_on_cortexso_hub(self, model_url):
2828
2929 await wait_for_websocket_download_success_event (timeout = None )
3030
31+ print ("Check if the model was pulled successfully" )
3132 # Check if the model was pulled successfully
3233 get_model_response = requests .get (
3334 f"http://127.0.0.1:3928/v1/models/{ model_url } "
@@ -37,16 +38,19 @@ async def test_models_on_cortexso_hub(self, model_url):
3738 get_model_response .json ()["model" ] == model_url
3839 ), f"Unexpected model name for: { model_url } "
3940
41+ print ("Check if the model is available in the list of models" )
4042 # Check if the model is available in the list of models
4143 response = requests .get ("http://localhost:3928/v1/models" )
4244 assert response .status_code == 200
4345 models = [i ["id" ] for i in response .json ()["data" ]]
4446 assert model_url in models , f"Model not found in list: { model_url } "
4547
48+ print ("Start the model" )
4649 # Start the model
4750 response = requests .post ("http://localhost:3928/v1/models/start" , json = json_body )
4851 assert response .status_code == 200 , f"status_code: { response .status_code } "
4952
53+ print ("Send an inference request" )
5054 # Send an inference request
5155 inference_json_body = {
5256 "frequency_penalty" : 0.2 ,
@@ -69,6 +73,7 @@ async def test_models_on_cortexso_hub(self, model_url):
6973 response = requests .post ("http://localhost:3928/v1/chat/completions" , json = inference_json_body , headers = {"Content-Type" : "application/json" })
7074 assert response .status_code == 200 , f"status_code: { response .status_code } response: { response .json ()} "
7175
76+ print ("Stop the model" )
7277 # Stop the model
7378 response = requests .post ("http://localhost:3928/v1/models/stop" , json = json_body )
7479 assert response .status_code == 200 , f"status_code: { response .status_code } "
0 commit comments