INNER CODE UNIT · Python

classify_batched

maxpumperla/learning_ray · notebooks/app.py:50

    async def classify_batched(self, batched_inputs):
        print("Got batch size:", len(batched_inputs))
        results = self._classifier(batched_inputs)
        return [result["label"] for result in results]

    @app.get("/")
    async def classify(self, input_text: str) -> str:
        return await self.classify_batched(input_text)


batched_deployment = SentimentAnalysis.bind()


from typing import Optional

import wikipedia

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…