(self, module)
| 46 | cleanup() |
| 47 | |
| 48 | def warp_into_web(self, module): |
| 49 | client = None |
| 50 | for _ in range(5): |
| 51 | try: |
| 52 | port = random.randint(10000, 30000) |
| 53 | web = lazyllm.WebModule(module, port=port) |
| 54 | web._work() |
| 55 | time.sleep(2) |
| 56 | except AssertionError as e: |
| 57 | # Port is occupied |
| 58 | if 'occupied' in e: |
| 59 | continue |
| 60 | else: |
| 61 | raise e |
| 62 | try: |
| 63 | client = Client(web.url, download_files=web.cach_path) |
| 64 | break |
| 65 | except httpx.ConnectError: |
| 66 | continue |
| 67 | assert client, 'Unable to create client' |
| 68 | self.webs.append(web) |
| 69 | self.clients.append(client) |
| 70 | return web, client |
| 71 | |
| 72 | @pytest.mark.run_on_change( |
| 73 | 'lazyllm/components/deploy/vllm.py', |
no test coverage detected