Skip to main content

Marshio

springboot-demo
A springboot project for dependencies usage
My Site
未完成备案,暂不支持访问
bookshelf
Detailed description of the book
yuque
Detailed description of the article
steam
Detailed description of the article
Ollama
# 从远端拉去一个模型
% ollama pull qwen3:1.7b

# 启动一个本地模型
% ollama run qwen3:1.7b

# 查看本地有哪些模型
% ollama list
NAME                ID              SIZE      MODIFIED     
qwen2.5:1.5b        65ec06548149    986 MB    6 months ago    
qwen3:1.7b          8f68893c685c    1.4 GB    6 months ago    
deepseek-r1:1.5b    e0979632db5a    1.1 GB    7 months ago    

# 查看正在运行的本地模型
% ollama ps  
NAME          ID              SIZE      PROCESSOR    CONTEXT    UNTIL              
qwen3:1.7b    8f68893c685c    1.9 GB    100% GPU     4096       4 minutes from now  

# 删除模型
% ollama rm deepseek-r1:1.5b

# 设置 openclaw
% ollama launch openclaw --model deepseek-r1:1.5b

MarshioLess than 1 minutellmvlm
process

process

process 是 Node.js 的全局对象,提供当前进程信息和控制。

对象 含义
process.env 包含所有的环境变量
process.args 包含所有的命令行参数
process.cwd() 当前进程的工作目录

MarshioLess than 1 minute
RAG prepare

检索算法

检索,retrieval,是 RAG 中最重要的第一步。完整的检索流程包含两个阶段:表征(将文本转化为数学表示) 与 匹配(在数据库中寻找最相似的结果)。

稀疏检索(Sparse Retrieval)

稀疏检索主要基于关键词匹配。它非常擅长处理精确匹配(如人名、产品型号、特定术语),但难以理解同义词。

传统稀疏检索

  • TF-IDF: 经典的加权方法,根据词频(TF)和逆文档频率(IDF)计算权重。
  • BM25(Best Matching 25)

神经稀疏检索


MarshioAbout 3 minllmvlm
PostgreSQL 时间类型

官网 datetime 介绍

首先,postgre 并没有 datetime 类型,只有如下这些类型。

Name Storage Size Description Low Value High Value Resolution
timestamp [ (*p*) ] [ without time zone ] 8 bytes both date and time (no time zone) 4713 BC 294276 AD 1 microsecond
timestamp [ (*p*) ] with time zone 8 bytes both date and time, with time zone 4713 BC 294276 AD 1 microsecond
date 4 bytes date (no time of day) 4713 BC 5874897 AD 1 day
time [ (*p*) ] [ without time zone ] 8 bytes time of day (no date) 00:00:00 24:00:00 1 microsecond
time [ (*p*) ] with time zone 12 bytes time of day (no date), with time zone 00:00:00+1559 24:00:00-1559 1 microsecond
interval [ *fields* ] [ (*p*) ] 16 bytes time interval -178000000 years 178000000 years 1 microsecond

MarshioLess than 1 minutepostgresql
pg命令

前言

以下命令中[]表示可选项,

角色/用户

在postgres13中,用户和角色共用一张表,用户和角色的关系通过rolcanlogin区分,能LOGIN的是user,不能LOGIN的是role(目前来看,不保准后面会有特例)。 参考 https://www.postgresql.org/docs/15/sql-alterrole.html


MarshioAbout 6 minpostgresql