Spaces:
Sleeping
Sleeping
Update brain.py
Browse files
brain.py
CHANGED
|
@@ -70,6 +70,16 @@ Rules:
|
|
| 70 |
@app.route("/api/chat", methods=["POST"])
|
| 71 |
def stream():
|
| 72 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
if model is None:
|
| 74 |
|
| 75 |
return Response(
|
|
|
|
| 70 |
@app.route("/api/chat", methods=["POST"])
|
| 71 |
def stream():
|
| 72 |
|
| 73 |
+
def generate():
|
| 74 |
+
|
| 75 |
+
yield "data: Hello World\n\n"
|
| 76 |
+
yield "data: [DONE]\n\n"
|
| 77 |
+
|
| 78 |
+
return Response(
|
| 79 |
+
generate(),
|
| 80 |
+
mimetype="text/event-stream"
|
| 81 |
+
)
|
| 82 |
+
|
| 83 |
if model is None:
|
| 84 |
|
| 85 |
return Response(
|