当前位置: 首页 > wzjs >正文

南京 推广 网站建设温州seo品牌优化软件

南京 推广 网站建设,温州seo品牌优化软件,wordpress4.6 手册,嵩县网站开发每一篇文章前后都增加返回目录 回到目录 【评测】Qwen3-Embedding模型初体验 模型的介绍页面 本机配置:八代i5-8265U,16G内存,无GPU核显运行,win10操作系统 ollama可以通过下面命令拉取模型: ollama pull modelscope…

每一篇文章前后都增加返回目录
回到目录

【评测】Qwen3-Embedding模型初体验

模型的介绍页面
本机配置:八代i5-8265U,16G内存,无GPU核显运行,win10操作系统
ollama可以通过下面命令拉取模型:
ollama pull modelscope.cn/Qwen/Qwen3-Embedding-8B-GGUF
下面直接使用介绍页面的sample代码体验一下模型的威力。

1. modelscope下载模型

$ modelscope download --model Qwen/Qwen3-Embedding-0.6B
$ modelscope download --model Qwen/Qwen3-Embedding-8B
0.6B模型 1.12GB 8B模型 14.1GB

2. 修改sample代码从本地加载模型

默认代码运行报错:
OSError: We couldn’t connect to ‘https://huggingface.co’ to load the files, and couldn’t find them in the cached files.

# test_qwen3-embedding.py# Requires transformers>=4.51.0
# Requires sentence-transformers>=2.7.0from sentence_transformers import SentenceTransformer# Load the model
#model = SentenceTransformer("Qwen/Qwen3-Embedding-8B")  改为下面代码本地加载模型
model = SentenceTransformer("C:\\Users\\Administrator\\.cache\\modelscope\\hub\models\\Qwen\\Qwen3-Embedding-8B")# We recommend enabling flash_attention_2 for better acceleration and memory saving,
# together with setting `padding_side` to "left":
# model = SentenceTransformer(
#     "Qwen/Qwen3-Embedding-8B",
#     model_kwargs={"attn_implementation": "flash_attention_2", "device_map": "auto"},
#     tokenizer_kwargs={"padding_side": "left"},
# )# The queries and documents to embed
queries = ["What is the capital of China?","Explain gravity",
]
documents = ["The capital of China is Beijing.","Gravity is a force that attracts two bodies towards each other. It gives weight to physical objects and is responsible for the movement of planets around the sun.",
]# Encode the queries and documents. Note that queries benefit from using a prompt
# Here we use the prompt called "query" stored under `model.prompts`, but you can
# also pass your own prompt via the `prompt` argument
query_embeddings = model.encode(queries, prompt_name="query")
document_embeddings = model.encode(documents)# Compute the (cosine) similarity between the query and document embeddings
similarity = model.similarity(query_embeddings, document_embeddings)
print(similarity)
# tensor([[0.7493, 0.0751],
#         [0.0880, 0.6318]])

可能是机器配置太低问题,无法正常执行出结果
D:\workspace\test_qwen3-embedding.py:8: SyntaxWarning: invalid escape sequence ‘\m’
model = SentenceTransformer(“C:\Users\Administrator\.cache\modelscope\hub\models\Qwen\Qwen3-Embedding-8B”)
Loading checkpoint shards: 25%|██████████████▎ | 1/4 [00:14<00:42, 14.24s/it]

3. 修改sample代码为0.6B模型

# test_qwen3-embedding.py
。。。
# Load the model
#model = SentenceTransformer("Qwen/Qwen3-Embedding-8B")  改为下面代码本地加载模型
model = SentenceTransformer("C:\\Users\\Administrator\\.cache\\modelscope\\hub\models\\Qwen\\Qwen3-Embedding-8B")
。。。

(workspace) PS D:\workspace> uv run .\test_qwen3-embedding.py
D:\workspace\test_qwen3-embedding.py:8: SyntaxWarning: invalid escape sequence ‘\m’
model = SentenceTransformer(“C:\Users\Administrator\.cache\modelscope\hub\models\Qwen\Qwen3-Embedding-0.6B”)
tensor([[0.7646, 0.1414],
[0.1355, 0.6000]])

运行成功,几秒钟出结果,CPU呼呼的转,最终效果可以接受吗?

每一篇文章前后都增加返回目录
回到目录

http://www.dtcms.com/wzjs/434840.html

相关文章:

  • 大连哪家公司做网站好域名解析在线查询
  • 杭州知名的网站建设策划网站优化排名查询
  • 我想注册网站怎么做网络营销是指
  • 大型门户网站 代码长沙seo
  • 如何建造企业网站seo优化排名技术百度教程
  • 公司网站建设前期情况说明网络推广应该怎么做啊
  • 凤城网站建设seo岗位是什么意思
  • 网络游戏服务网排名优化百度
  • 企业网站建设很有必要职业培训机构哪家最好
  • 中国建设银行个人卡信息网站环球军事网
  • 神魔网站建设企业网站的推广阶段
  • wordpress怎么登录seo诊断书案例
  • 网站做的一样算侵权吗百度网站下载安装
  • 自己做网站需要学什么软件下载百度搜索广告推广
  • 电子商务网站对比分析长春关键词优化报价
  • 10个好用的wordpress投票_评分插件深圳seo推广外包
  • 餐饮手机网站建设希爱力跟万艾可哪个猛
  • 网站与微信对接东莞优化排名推广
  • 网站建设宗旨企业网址怎么注册
  • 网络营销和电子商务的不同徐州seo企业
  • 云南住建局和城乡建设报考网站竞价推广渠道
  • 番禺企业网站建设b站推广网站入口2023是什么
  • 网站推广优化联系方式网络域名
  • 怎么制作网站一键更新百度地图下载2022新版安装
  • 营销型网站技术特点重庆森林为什么叫这个名字
  • 我们是设计师 网站建设专家it培训机构排行榜
  • 做英文网站常用的字体最新新闻热点事件2023
  • 做普通网站公司短链接在线生成官网
  • 国内做钢铁的网站南昌百度seo
  • 网站设计自学百度问答下载安装