Skip to content

Commit c1be591

Browse files
author
Hao Ni (CSI Interfusion Co Ltd)
committed
fix lint
1 parent caefc0e commit c1be591

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

examples/apo/legacy_apo_lunch.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import asyncio
2525
from pathlib import Path
2626

27+
2728
async def stream_output(stream, name, pipe_type, buffer):
2829
"""Asynchronously read output stream and print to console, also store in memory buffer"""
2930
while True:
@@ -34,13 +35,10 @@ async def stream_output(stream, name, pipe_type, buffer):
3435
print(f"[{name}] {text}")
3536
buffer.append(text)
3637

38+
3739
async def run(cmd, name, buffer):
3840
"""Start a subprocess and launch the logging coroutine"""
39-
proc = await asyncio.create_subprocess_exec(
40-
*cmd,
41-
stdout=asyncio.subprocess.PIPE,
42-
stderr=asyncio.subprocess.PIPE
43-
)
41+
proc = await asyncio.create_subprocess_exec(*cmd, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE)
4442
print(f"{name} started (pid={proc.pid})")
4543

4644
# concurrently monitor stdout and stderr
@@ -49,6 +47,7 @@ async def run(cmd, name, buffer):
4947

5048
return proc
5149

50+
5251
async def main():
5352
# prepare in-memory buffers for each process
5453
server_buffer = []
@@ -67,8 +66,9 @@ async def main():
6766

6867
print("Logs saved to legacy_apo_server.log and legacy_apo_client.log")
6968

69+
7070
if __name__ == "__main__":
7171
try:
7272
asyncio.run(main())
7373
except KeyboardInterrupt:
74-
print("\nInterrupted by user, cleaning up...")
74+
print("\nInterrupted by user, cleaning up...")

examples/apo/legacy_apo_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ async def example_apo():
2323
"You are a helpful assistant.",
2424
"You are a knowledgeable AI.",
2525
"You are a friendly chatbot.",
26-
"You are an experienced expert."
26+
"You are an experienced expert.",
2727
]
2828

2929
prompt_and_rewards: list[tuple[str, float]] = []

0 commit comments

Comments
 (0)