Browse Source

trigger start download without waiting for it to finish

Alex Cheema 6 months ago
parent
commit
af78341151
1 changed files with 2 additions and 3 deletions
  1. 2 3
      exo/api/chatgpt_api.py

+ 2 - 3
exo/api/chatgpt_api.py

@@ -419,12 +419,11 @@ class ChatGPTAPI:
       if model_name not in model_cards: return web.json_response({"error": f"Invalid model: {model_name}. Supported models: {list(model_cards.keys())}"}, status=400)
       shard = build_base_shard(model_name, self.inference_engine_classname)
       if not shard: return web.json_response({"error": f"Could not build shard for model {model_name}"}, status=400)
-
-      await self.node.inference_engine.ensure_shard(shard)
+      asyncio.create_task(self.node.inference_engine.ensure_shard(shard))
 
       return web.json_response({
         "status": "success",
-        "message": f"Download triggered for model: {model_name}"
+        "message": f"Download started for model: {model_name}"
       })
     except Exception as e:
       if DEBUG >= 2: traceback.print_exc()