Ashley Wright commited on
Commit
921dd6f
1 Parent(s): fcd4555

Handle EOF

Browse files
Files changed (1) hide show
  1. src/main.py +6 -1
src/main.py CHANGED
@@ -27,7 +27,12 @@ def main():
27
  print(f"Connected")
28
 
29
  while True:
30
- request = TextToImageRequest.model_validate_json(connection.recv_bytes().decode("utf-8"))
 
 
 
 
 
31
 
32
  image = infer(request, pipeline)
33
 
 
27
  print(f"Connected")
28
 
29
  while True:
30
+ try:
31
+ request = TextToImageRequest.model_validate_json(connection.recv_bytes().decode("utf-8"))
32
+ except EOFError:
33
+ print(f"Inference socket exiting")
34
+
35
+ return
36
 
37
  image = infer(request, pipeline)
38