Skip to content

Commit 43b9ad5

Browse files
committed
Fix serialization async issue
1 parent 48d4d08 commit 43b9ad5

File tree

7 files changed

+17
-16
lines changed

7 files changed

+17
-16
lines changed

demo/.env.backend

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
DATABASE_URI=~/.synalinks/data
2-
31
LLM_PROVIDER=ollama_chat/deepseek-r1
42
EMBEDDING_PROVIDER=ollama/mxbai-embed-large
53

demo/backend/app/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
@app.post("/v1/chat_completion")
4646
async def chat_completion(messages: synalinks.ChatMessages):
47-
result = program(messages)
47+
result = await program(messages)
4848
return result.json() if result else None
4949

5050

demo/backend/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
fastapi[standard]
22
uvicorn
3-
lancedb
43
synalinks
54
mlflow

demo/docker-compose.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ services:
44
image: ghcr.io/mlflow/mlflow:latest
55
ports:
66
- "5000:5000"
7-
frontend:
8-
build:
9-
context: ./frontend
10-
dockerfile: Dockerfile
11-
ports:
12-
- "3000:3000"
13-
depends_on:
14-
- backend
15-
env_file:
16-
- .env.frontend
7+
# frontend:
8+
# build:
9+
# context: ./frontend
10+
# dockerfile: Dockerfile
11+
# ports:
12+
# - "3000:3000"
13+
# depends_on:
14+
# - backend
15+
# env_file:
16+
# - .env.frontend
1717
backend:
1818
build:
1919
context: ./backend

demo/frontend/Dockerfile

Whitespace-only changes.

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ if __name__ == "__main__":
182182
asyncio.run(main())
183183
```
184184

185-
## Getting summary of your program
185+
## Getting a summary of your program
186186

187187
To print a tabular summary of your program:
188188

synalinks/src/programs/functional.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Modified from: keras/src/models/functional.py
2+
# Original authors: François Chollet et al. (Keras Team)
3+
# License Apache 2.0: (c) 2025 Yoan Sallami (Synalinks Team)
4+
15
import copy
26
import inspect
37
import typing
@@ -323,7 +327,7 @@ def process_node(module, node_data):
323327
args, kwargs = deserialize_node(node_data, created_modules)
324328
# Call module on its inputs, thus creating the node
325329
# and building the module if needed.
326-
module(*args, **kwargs)
330+
asyncio.get_event_loop().run_until_complete(module(*args, **kwargs))
327331

328332
def process_module(module_data):
329333
"""Deserializes a module and index its inbound nodes.

0 commit comments

Comments
 (0)