Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -156,13 +156,15 @@ async def echo(websocket):
|
|
156 |
while response.startswith("\n"):
|
157 |
response = response[1:]
|
158 |
await websocket.send(json.dumps({"response": response}))
|
159 |
-
except Exception:
|
160 |
-
|
|
|
161 |
|
162 |
async def main():
|
163 |
try:
|
164 |
async with serve(echo, "0.0.0.0", 7860):
|
165 |
await asyncio.Future()
|
166 |
-
except Exception:
|
167 |
-
|
|
|
168 |
asyncio.run(main())
|
|
|
156 |
while response.startswith("\n"):
|
157 |
response = response[1:]
|
158 |
await websocket.send(json.dumps({"response": response}))
|
159 |
+
except Exception as e:
|
160 |
+
print("Oops :P Something happened.")
|
161 |
+
print(type(e))
|
162 |
|
163 |
async def main():
|
164 |
try:
|
165 |
async with serve(echo, "0.0.0.0", 7860):
|
166 |
await asyncio.Future()
|
167 |
+
except Exception as echo:
|
168 |
+
print("Oops :P Something happened.")
|
169 |
+
print(type(e))
|
170 |
asyncio.run(main())
|