Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"""
import os, sys, json, time, hashlib, sqlite3

BASE = "/Users/yusteven/Desktop/weflow/source"
DB = "/Users/yusteven/Desktop/weflow/chat.db"
BASE = "source"
DB = "chat.db"

EMBED_TYPES = {"文本消息", "引用消息", "聊天记录"} # 进语义层的类型
MODEL_NAME, DIM, MAX_SEQ = "BAAI/bge-m3", 1024, 512
Expand Down
6 changes: 5 additions & 1 deletion query.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
import sys, os, argparse, sqlite3, datetime
import build

TMP_DIR = "tmp"

Comment on lines +19 to +20

def con():
return sqlite3.connect(build.DB)
Expand Down Expand Up @@ -169,7 +171,9 @@ def cmd_media(a):
if not row:
print(f"消息 #{a.msg_id} 没有已入库的媒体。"); return
filename, blob = row
out = a.out or os.path.join("/tmp", filename or f"media_{a.msg_id}.bin")
if not a.out:
os.makedirs(TMP_DIR, exist_ok=True)
out = a.out or os.path.join(TMP_DIR, filename or f"media_{a.msg_id}.bin")
with open(out, "wb") as f: f.write(blob)
print(f"已导出: {out} ({len(blob):,} 字节)")

Expand Down