Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7d3be849d9 | |||
| 0397af719d | |||
| 4fdc314fd9 | |||
| 639d82f5b4 | |||
| 4e2f2311d0 | |||
| 38782d89bc | |||
| 0185216ccb | |||
| b20d9e714c | |||
| b1eb65d75d | |||
| 1d09d7fe96 |
+2
-2
@@ -59,12 +59,12 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Fork testing
|
# Fork testing
|
||||||
git clone "${PYWORKER_REPO:-https://github.com/vast-ai/pyworker}" "$SERVER_DIR"
|
[[ ! -d $SERVER_DIR ]] && git clone "${PYWORKER_REPO:-https://github.com/vast-ai/pyworker}" "$SERVER_DIR"
|
||||||
if [[ -n ${PYWORKER_REF:-} ]]; then
|
if [[ -n ${PYWORKER_REF:-} ]]; then
|
||||||
(cd "$SERVER_DIR" && git checkout "$PYWORKER_REF")
|
(cd "$SERVER_DIR" && git checkout "$PYWORKER_REF")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
uv venv --managed-python "$ENV_PATH" -p 3.10
|
uv venv --python-preference only-managed "$ENV_PATH" -p 3.10
|
||||||
source "$ENV_PATH/bin/activate"
|
source "$ENV_PATH/bin/activate"
|
||||||
|
|
||||||
uv pip install -r "${SERVER_DIR}/requirements.txt"
|
uv pip install -r "${SERVER_DIR}/requirements.txt"
|
||||||
|
|||||||
@@ -33,6 +33,9 @@ log = logging.getLogger(__file__)
|
|||||||
async def generate_client_response(
|
async def generate_client_response(
|
||||||
client_request: web.Request, model_response: ClientResponse
|
client_request: web.Request, model_response: ClientResponse
|
||||||
) -> Union[web.Response, web.StreamResponse]:
|
) -> Union[web.Response, web.StreamResponse]:
|
||||||
|
match model_response.status:
|
||||||
|
case 200:
|
||||||
|
log.debug("SUCCESS")
|
||||||
# Check if the response is actually streaming based on response headers/content-type
|
# Check if the response is actually streaming based on response headers/content-type
|
||||||
is_streaming_response = (
|
is_streaming_response = (
|
||||||
model_response.content_type == "text/event-stream"
|
model_response.content_type == "text/event-stream"
|
||||||
@@ -59,6 +62,9 @@ async def generate_client_response(
|
|||||||
status=model_response.status,
|
status=model_response.status,
|
||||||
content_type=model_response.content_type
|
content_type=model_response.content_type
|
||||||
)
|
)
|
||||||
|
case code:
|
||||||
|
log.debug(f"Model responded with error {code}")
|
||||||
|
return web.Response(status=code)
|
||||||
|
|
||||||
|
|
||||||
@dataclasses.dataclass
|
@dataclasses.dataclass
|
||||||
@@ -70,7 +76,7 @@ class ComfyWorkflowHandler(EndpointHandler[ComfyWorkflowData]):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def healthcheck_endpoint(self) -> Optional[str]:
|
def healthcheck_endpoint(self) -> Optional[str]:
|
||||||
return "/health"
|
return f"{MODEL_SERVER_URL}/health"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def payload_cls(cls) -> Type[ComfyWorkflowData]:
|
def payload_cls(cls) -> Type[ComfyWorkflowData]:
|
||||||
|
|||||||
Reference in New Issue
Block a user