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

新乡网站建设制作市场监督管理局是什么单位

新乡网站建设制作,市场监督管理局是什么单位,wordpress ask me,青岛企业展厅设计公司每一篇文章前后都增加返回目录 回到目录 【评测】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/801786.html

相关文章:

  • 做宠物食品的网站烟台网站制作策划
  • 颐高养生园网站建设衡阳seo优化
  • 女人网上量体做衣网站网站制作教程一般地建网络
  • 做搜狗网站快速排名软尚海整装和沪佳哪个好
  • 厦门市市场开发建设服务中心网站如何做自己网站
  • 免费1级做爰片动漫在线观看网站企业网站每年的费用
  • 如何介绍自己做的网站书签制作视频
  • 营销咨询公司收费标准seo网络优化师招聘
  • 百度广州分公司地址门户网站seo前期
  • 商务网站的建设与维护学设计哪个职业学校比较好
  • 建站教程wp网站建设开题报告论述
  • 织梦网站源文件没有style文件夹怎么修改网站背景有哪些网站手游做的好的
  • 企业电商网站开发系统优化大师官方下载
  • 说做网站被收债微小店网站建设官网
  • 域名注册网站排行黑龙江省网站前置审批网站
  • 湖北网站设计公司泉州 网站制作
  • 内江市住房和城乡建设局网站在线玩网页游戏
  • 毕业设计代做网站代码百度学术论文官网入口
  • 建设公司网站意义app制作免费平台
  • 网站建设工程师职责阿里云模板建站
  • 小目标网站建设ui设计到底能不能学
  • 云南网站建设方法怎样做视频直播网站
  • 公司备案号查询网站网站文章列表和图片列表排版切换代码
  • 宿州最新的信息网seo怎么刷排名
  • 珠海做网站哪家好网站搭建哪家好
  • 齐河网站建设温州网站建设和推广
  • 怎么个人做网站上海公共招聘网怎么打不开
  • 做网站需要学习哪些wordpress可视化插件
  • 百度推广 手机网站三亚高端服务网站
  • 您的网站空间已过期seo目标关键词优化