Commit 9dba332
authored
Scheduler: update exampels (#807)
* fix bugs: try to fix bugs in _submit_web_logs
* fix bugs: try to address bugs
* fix bugs
* refactor: modify examples
* revise add operation and fix an unbelievable bug
* address the bug issues
* the doc file has a format problem which has been fixed in this commit
* add a range of new feats for the add operation
* address the incompatible issue of local scheduler
* feat(scheduler): optimize redis queue consumer group management
- Proactively ensure consumer groups exist in '_refresh_stream_keys' for newly discovered streams.
- Remove redundant consumer group checks in '_read_new_messages_batch' to improve read performance.
- Clean up 'seen_streams' cache when streams are deleted to ensure correct group recreation.
- This change reduces unnecessary Redis calls during high-frequency polling.
* fix(tests): resolve AttributeError in SimpleStructMemReader tests
- Import 'parse_json_result' from 'memos.mem_reader.utils' instead of accessing it as an instance attribute.
- Fixes 'AttributeError: 'SimpleStructMemReader' object has no attribute 'parse_json_result'' in 'test_parse_json_result_success' and 'test_parse_json_result_failure'.
- Remove incorrect mock assignment of 'parse_json_result' in 'test_process_chat_data'.
* fix(mem_reader): pass info dict to add_before_search for correct user_id usage
- Update 'add_before_search' signature in 'SimpleStructMemReader' to accept 'info' dict.
- Pass 'info' (containing 'user_id' and 'session_id') to 'self.searcher.search' instead of using empty strings.
- Add 'test_add_before_search' to 'TestSimpleStructMemReader' to verify the fix and ensure 'searcher.search' receives the correct 'info'.
- This ensures that memory searches are scoped to the correct user and session.
* refactor add_before_search from mem_reader to SingleCubeView
* address bugs
* fix: fix the qsize bug of task queue, and accept change from hotfix/scheduler
* fix: address some issues to run old scheduler example and kv cache example
* fix: address the issue of Top-level import of unavailable module 'torch'
* fix: resolve linting errors and make optional dependencies lazy loaded
- Fix ambiguous characters and commented-out code in examples/mem_scheduler/quick_start_examples.py
- Fix nested if statements in src/memos/mem_os/core.py
- Move torch and transformers imports to method scope in src/memos/llms/hf.py to support optional dependencies
- Update tests/llms/test_hf.py to patch transformers module directly
* refactor: revise the rewrite prompt to make it better
* refactor: update examples
* refactor: update examples for scheduler1 parent acb5799 commit 9dba332
1 file changed
+98
-41
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
152 | 151 | | |
| 152 | + | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
| 155 | + | |
156 | 156 | | |
| 157 | + | |
157 | 158 | | |
158 | 159 | | |
159 | | - | |
| 160 | + | |
160 | 161 | | |
161 | | - | |
| 162 | + | |
162 | 163 | | |
| 164 | + | |
163 | 165 | | |
164 | | - | |
| 166 | + | |
| 167 | + | |
165 | 168 | | |
166 | | - | |
| 169 | + | |
167 | 170 | | |
168 | 171 | | |
169 | | - | |
| 172 | + | |
170 | 173 | | |
171 | | - | |
| 174 | + | |
172 | 175 | | |
| 176 | + | |
173 | 177 | | |
174 | 178 | | |
175 | | - | |
| 179 | + | |
176 | 180 | | |
177 | 181 | | |
178 | 182 | | |
179 | 183 | | |
180 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
181 | 229 | | |
182 | 230 | | |
183 | | - | |
184 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
185 | 234 | | |
| 235 | + | |
186 | 236 | | |
187 | 237 | | |
| 238 | + | |
188 | 239 | | |
189 | 240 | | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
| 241 | + | |
| 242 | + | |
197 | 243 | | |
| 244 | + | |
198 | 245 | | |
199 | 246 | | |
200 | 247 | | |
201 | 248 | | |
| 249 | + | |
202 | 250 | | |
| 251 | + | |
203 | 252 | | |
204 | 253 | | |
205 | | - | |
206 | | - | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
207 | 257 | | |
| 258 | + | |
208 | 259 | | |
209 | 260 | | |
| 261 | + | |
210 | 262 | | |
| 263 | + | |
211 | 264 | | |
212 | | - | |
| 265 | + | |
213 | 266 | | |
214 | 267 | | |
215 | | - | |
216 | | - | |
217 | | - | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
218 | 271 | | |
219 | 272 | | |
220 | 273 | | |
221 | | - | |
| 274 | + | |
222 | 275 | | |
223 | 276 | | |
224 | 277 | | |
225 | 278 | | |
226 | 279 | | |
227 | 280 | | |
228 | | - | |
| 281 | + | |
229 | 282 | | |
| 283 | + | |
230 | 284 | | |
231 | 285 | | |
| 286 | + | |
232 | 287 | | |
| 288 | + | |
233 | 289 | | |
234 | 290 | | |
| 291 | + | |
235 | 292 | | |
236 | 293 | | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
248 | 305 | | |
249 | 306 | | |
250 | 307 | | |
| |||
0 commit comments