MCPcopy
hub / github.com/LazyAGI/LazyLLM / warp_into_web

Method warp_into_web

tests/advanced_tests/Deploy/test_deploy.py:48–70  ·  view source on GitHub ↗
(self, module)

Source from the content-addressed store, hash-verified

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',

Callers 2

test_stt_sensevoiceMethod · 0.95
test_vlm_and_lmdeployMethod · 0.95

Calls 2

_workMethod · 0.95
appendMethod · 0.80

Tested by

no test coverage detected