From 146d2ed3b4dbd2350055b85f45a1e8ee9202c349 Mon Sep 17 00:00:00 2001 From: Keming Date: Thu, 2 May 2024 12:26:56 +0800 Subject: [PATCH] chore: fix typos and broken links Signed-off-by: Keming --- .github/workflows/links.yml | 2 +- docs/source/examples/embedding.md | 2 +- mosec/dry_run.py | 2 +- mosec/mixin/typed_worker.py | 5 +---- src/routes.rs | 2 +- 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml index a99d4cc4..befd2e1b 100644 --- a/.github/workflows/links.yml +++ b/.github/workflows/links.yml @@ -22,7 +22,7 @@ jobs: - uses: actions/checkout@v4 - name: Link Checker - uses: lycheeverse/lychee-action@v1.9.3 + uses: lycheeverse/lychee-action@v1 with: fail: true args: --verbose --no-progress --format detailed . diff --git a/docs/source/examples/embedding.md b/docs/source/examples/embedding.md index b973da42..a89a64f1 100644 --- a/docs/source/examples/embedding.md +++ b/docs/source/examples/embedding.md @@ -1,6 +1,6 @@ # OpenAI compatible embedding service -This example shows how to create an embedding service that is compatible with the [OpenAI API](https://platform.openai.com/docs/api-reference/embeddings/object). +This example shows how to create an embedding service that is compatible with the [OpenAI API](https://platform.openai.com/docs/api-reference/embeddings). In this example, we use the embedding model from [HuggingFace LeaderBoard](https://huggingface.co/spaces/mteb/leaderboard). diff --git a/mosec/dry_run.py b/mosec/dry_run.py index 5ab92937..1d33d6ec 100644 --- a/mosec/dry_run.py +++ b/mosec/dry_run.py @@ -174,7 +174,7 @@ def terminate(self, signum, framestack): self.shutdown_notify.set() def run(self): - """Execute thr dry run process.""" + """Execute the dry run process.""" for endpoint, runtimes in self.router.items(): logger.info( "init dry run for endpoint %s with %s", diff --git a/mosec/mixin/typed_worker.py b/mosec/mixin/typed_worker.py index 1c0e49a0..695fe087 100644 --- a/mosec/mixin/typed_worker.py +++ b/mosec/mixin/typed_worker.py @@ -38,11 +38,8 @@ def deserialize(self, data: Any) -> Any: """Deserialize and validate request with msgspec.""" import msgspec - if not self._input_typ: + if self._input_typ is None: self._input_typ = parse_func_type(self.forward, ParseTarget.INPUT) - if not issubclass(self._input_typ, msgspec.Struct): - # skip other annotation type - return super().deserialize(data) try: return msgspec.msgpack.decode(data, type=self._input_typ) diff --git a/src/routes.rs b/src/routes.rs index 60bb38cd..a62c4b51 100644 --- a/src/routes.rs +++ b/src/routes.rs @@ -35,7 +35,7 @@ const RESPONSE_EMPTY: &[u8] = b"no data provided"; const RESPONSE_TOO_LARGE: &[u8] = b"request body is too large"; const RESPONSE_SHUTDOWN: &[u8] = b"gracefully shutting down"; const DEFAULT_RESPONSE_MIME: &str = "application/json"; -const DEFAULT_MAX_REQUEST_SIZE: usize = 10 * 1024 * 1024; // 10MB +const DEFAULT_MAX_REQUEST_SIZE: usize = 10 * 1024 * 1024; // 10MiB fn build_response(status: StatusCode, content: Bytes) -> Response { Response::builder()