Skip to content

Commit fc74b13

Browse files
authored
Dev 20260126 v2.0.4 (MemTensor#976)
## Description <!-- Please include a summary of the changes below; Fill in the issue number that this PR addresses (if applicable); Fill in the related MemOS-Docs repository issue or PR link (if applicable); Mention the person who will review this PR (if you know who it is); Replace (summary), (issue), (docs-issue-or-pr-link), and (reviewer) with the appropriate information. 请在下方填写更改的摘要; 填写此 PR 解决的问题编号(如果适用); 填写相关的 MemOS-Docs 仓库 issue 或 PR 链接(如果适用); 提及将审查此 PR 的人(如果您知道是谁); 替换 (summary)、(issue)、(docs-issue-or-pr-link) 和 (reviewer) 为适当的信息。 --> Summary: (summary) Fix: #(issue) Docs Issue/PR: (docs-issue-or-pr-link) Reviewer: @(reviewer) ## Checklist: - [ ] I have performed a self-review of my own code | 我已自行检查了自己的代码 - [ ] I have commented my code in hard-to-understand areas | 我已在难以理解的地方对代码进行了注释 - [ ] I have added tests that prove my fix is effective or that my feature works | 我已添加测试以证明我的修复有效或功能正常 - [ ] I have created related documentation issue/PR in [MemOS-Docs](https://github.com/MemTensor/MemOS-Docs) (if applicable) | 我已在 [MemOS-Docs](https://github.com/MemTensor/MemOS-Docs) 中创建了相关的文档 issue/PR(如果适用) - [ ] I have linked the issue to this PR (if applicable) | 我已将 issue 链接到此 PR(如果适用) - [ ] I have mentioned the person who will review this PR | 我已提及将审查此 PR 的人
2 parents f83c5d5 + 24e2fd7 commit fc74b13

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+3446
-169
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,37 @@
11
## Description
22

3-
<!--
4-
Please include a summary of the changes below;
5-
Fill in the issue number that this PR addresses (if applicable);
6-
Fill in the related MemOS-Docs repository issue or PR link (if applicable);
7-
Mention the person who will review this PR (if you know who it is);
8-
Replace (summary), (issue), (docs-issue-or-pr-link), and (reviewer) with the appropriate information.
3+
Please include a summary of the change, the problem it solves, the implementation approach, and relevant context. List any dependencies required for this change.
94

10-
请在下方填写更改的摘要;
11-
填写此 PR 解决的问题编号(如果适用);
12-
填写相关的 MemOS-Docs 仓库 issue 或 PR 链接(如果适用);
13-
提及将审查此 PR 的人(如果您知道是谁);
14-
替换 (summary)、(issue)、(docs-issue-or-pr-link) 和 (reviewer) 为适当的信息。
15-
-->
5+
Related Issue (Required): Fixes @issue_number
166

17-
Summary: (summary)
7+
## Type of change
188

19-
Fix: #(issue)
9+
Please delete options that are not relevant.
2010

21-
Docs Issue/PR: (docs-issue-or-pr-link)
11+
- [ ] Bug fix (non-breaking change which fixes an issue)
12+
- [ ] New feature (non-breaking change which adds functionality)
13+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
14+
- [ ] Refactor (does not change functionality, e.g. code style improvements, linting)
15+
- [ ] Documentation update
2216

23-
Reviewer: @(reviewer)
17+
## How Has This Been Tested?
2418

25-
## Checklist:
19+
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
20+
21+
- [ ] Unit Test
22+
- [ ] Test Script Or Test Steps (please provide)
23+
- [ ] Pipeline Automated API Test (please provide)
24+
25+
## Checklist
2626

2727
- [ ] I have performed a self-review of my own code | 我已自行检查了自己的代码
2828
- [ ] I have commented my code in hard-to-understand areas | 我已在难以理解的地方对代码进行了注释
2929
- [ ] I have added tests that prove my fix is effective or that my feature works | 我已添加测试以证明我的修复有效或功能正常
3030
- [ ] I have created related documentation issue/PR in [MemOS-Docs](https://github.com/MemTensor/MemOS-Docs) (if applicable) | 我已在 [MemOS-Docs](https://github.com/MemTensor/MemOS-Docs) 中创建了相关的文档 issue/PR(如果适用)
3131
- [ ] I have linked the issue to this PR (if applicable) | 我已将 issue 链接到此 PR(如果适用)
3232
- [ ] I have mentioned the person who will review this PR | 我已提及将审查此 PR 的人
33+
34+
## Reviewer Checklist
35+
- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
36+
- [ ] Made sure Checks passed
37+
- [ ] Tests have been provided

docker/requirements-full.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ nvidia-cusparselt-cu12==0.6.3
8989
nvidia-nccl-cu12==2.26.2
9090
nvidia-nvjitlink-cu12==12.6.85
9191
nvidia-nvtx-cu12==12.6.77
92-
ollama==0.4.9
92+
ollama==0.5.0
9393
onnxruntime==1.22.1
9494
openai==1.97.0
9595
openapi-pydantic==0.5.1
@@ -184,3 +184,4 @@ py-key-value-aio==0.2.8
184184
py-key-value-shared==0.2.8
185185
PyJWT==2.10.1
186186
pytest==9.0.2
187+
alibabacloud-oss-v2==1.2.2

docker/requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ mdurl==0.1.2
5454
more-itertools==10.8.0
5555
neo4j==5.28.1
5656
numpy==2.3.4
57-
ollama==0.4.9
57+
ollama==0.5.0
5858
openai==1.109.1
5959
openapi-pydantic==0.5.1
6060
orjson==3.11.4
@@ -123,3 +123,4 @@ uvicorn==0.38.0
123123
uvloop==0.22.1; sys_platform != 'win32'
124124
watchfiles==1.1.1
125125
websockets==15.0.1
126+
alibabacloud-oss-v2==1.2.2

examples/extras/nli_e2e_example.py

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
import sys
2+
import threading
3+
import time
4+
5+
import requests
6+
import uvicorn
7+
8+
from memos.extras.nli_model.client import NLIClient
9+
from memos.extras.nli_model.server.serve import app
10+
11+
12+
# Config
13+
PORT = 32534
14+
15+
16+
def run_server():
17+
print(f"Starting server on port {PORT}...")
18+
# Using a separate thread for the server
19+
uvicorn.run(app, host="127.0.0.1", port=PORT, log_level="info")
20+
21+
22+
def main():
23+
print("Initializing E2E Test...")
24+
25+
# Start server thread
26+
server_thread = threading.Thread(target=run_server, daemon=True)
27+
server_thread.start()
28+
29+
# Wait for server to be up
30+
print("Waiting for server to initialize (this may take time if downloading model)...")
31+
client = NLIClient(base_url=f"http://127.0.0.1:{PORT}")
32+
33+
# Poll until server is ready
34+
start_time = time.time()
35+
ready = False
36+
37+
# Wait up to 5 minutes for model download and initialization
38+
timeout = 300
39+
40+
while time.time() - start_time < timeout:
41+
try:
42+
# Check if docs endpoint is accessible
43+
resp = requests.get(f"http://127.0.0.1:{PORT}/docs", timeout=1)
44+
if resp.status_code == 200:
45+
ready = True
46+
break
47+
except requests.ConnectionError:
48+
pass
49+
except Exception:
50+
# Ignore other errors during startup
51+
pass
52+
53+
time.sleep(2)
54+
print(".", end="", flush=True)
55+
56+
print("\n")
57+
if not ready:
58+
print("Server failed to start in time.")
59+
sys.exit(1)
60+
61+
print("Server is up! Sending request...")
62+
63+
# Test Data
64+
source = "I like apples"
65+
targets = ["I like apples", "I hate apples", "Paris is a city"]
66+
67+
try:
68+
results = client.compare_one_to_many(source, targets)
69+
print("-" * 30)
70+
print(f"Source: {source}")
71+
print("Targets & Results:")
72+
for t, r in zip(targets, results, strict=False):
73+
print(f" - '{t}': {r.value}")
74+
print("-" * 30)
75+
76+
# Basic Validation
77+
passed = True
78+
if results[0].value != "Duplicate":
79+
print(f"FAILURE: Expected Duplicate for '{targets[0]}', got {results[0].value}")
80+
passed = False
81+
82+
if results[1].value != "Contradiction":
83+
print(f"FAILURE: Expected Contradiction for '{targets[1]}', got {results[1].value}")
84+
passed = False
85+
86+
if results[2].value != "Unrelated":
87+
print(f"FAILURE: Expected Unrelated for '{targets[2]}', got {results[2].value}")
88+
passed = False
89+
90+
if passed:
91+
print("\nSUCCESS: Logic verification passed!")
92+
else:
93+
print("\nFAILURE: Unexpected results!")
94+
95+
except Exception as e:
96+
print(f"Error during request: {e}")
97+
sys.exit(1)
98+
99+
100+
if __name__ == "__main__":
101+
try:
102+
main()
103+
except KeyboardInterrupt:
104+
print("\nTest interrupted.")

0 commit comments

Comments
 (0)