dog's picture
Duplicate from dog/custom-pipeline
c34a83a
raw
history blame contribute delete
401 Bytes
import time
from closedai import ClosedAIPipeline
from closedai.server import app, data # noqa
class MyPipeline(ClosedAIPipeline):
def __init__(self, **kwargs):
super().__init__(**kwargs)
def generate_completion(self, text, **kwargs):
for i in range(5):
yield f", and {i} (test)"
time.sleep(1)
pipeline = MyPipeline()
data["pipeline"] = pipeline