This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dash | |
from dash import dcc, html | |
from dash.dependencies import Input, Output | |
import pandas as pd | |
import plotly.graph_objs as obj | |
import uvicorn as uvicorn | |
from fastapi import FastAPI | |
from starlette.middleware.wsgi import WSGIMiddleware | |
import ray |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@pipeline.step | |
def preprocess(_input: str) -> PreprocessOutput: | |
pass | |
@pipeline.step(num_replicas=10, num_gpus=1) | |
class Model1: | |
def __call__(self, _input: PreprocessOutput) -> Model1Output: | |
pass | |
@pipeline.step(num_replicas=5, num_cpus=1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
from ray import serve | |
@serve.deployment | |
class MessageConsumer: | |
def __init__(self, topic: str): | |
asyncio.get_running_loop().create_task( | |
self.poll_for_messages(topic) | |
) |
OlderNewer