File size: 401 Bytes
9a39434 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
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
|