Whisper fix

frdel committed Nov 19, 2024 at 10:37 UTC 970db9adc9677d8eb4fc047c47a215ffc65c826c
1 file changed +7 -16
python/helpers/runtime.py
+7 -16
@@ -1,6 +1,7 @@
1 import argparse
2 -from typing import Any, Callable, Coroutine
3 -from python.helpers import dotenv, rfc, docker, settings
2 +import inspect
3 +from typing import Any, Callable
4 +from python.helpers import dotenv, rfc, settings
5
6 parser = argparse.ArgumentParser()
7 args = {}
@@ -52,7 +53,10 @@ async def call_development_function(func: Callable, *args, **kwargs):
53 kwargs=kwargs,
54 )
55 else:
55 - return await func(*args, **kwargs)
56 + if inspect.iscoroutinefunction(func):
57 + return await func(*args, **kwargs)
58 + else:
59 + return func(*args, **kwargs)
60
61
62 async def handle_rfc(rfc_call: rfc.RFCCall):
@@ -72,16 +76,3 @@ def _get_rfc_url() -> str:
76 url += "/"
77 url += "rfc"
78 return url
75 - # if get_arg("rfc_url"):
76 - # return str(get_arg("rfc_url"))
77 - # global dockerman
78 - # if dockerman is None:
79 - # dockerman = docker.DockerContainerManager(
80 - # image="agent-zero-run",
81 - # name="agent-zero-development",
82 - # ports={"55080": 80, "55022": 22},
83 - # volumes={},
84 - # logger=None,
85 - # )
86 - # conts = dockerman.get_image_containers()
87 - # return f"http://localhost:{conts[0]['web_port']}/rfc"