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

难道做网站的工资都不高吗如何在百度上营销

难道做网站的工资都不高吗,如何在百度上营销,客源通app下载,营销品牌推广公司在处理插入milvus数据时,设置了字段长度为512. 明明考虑了预留,插入的数据中没有这么长的,但还是会有报错 类似:MilvusException: (code0, messagethe length (564) of 78th string exceeds max length (512) 查找max(len(x) for …

在处理插入milvus数据时,设置了字段长度为512. 明明考虑了预留,插入的数据中没有这么长的,但还是会有报错 类似:MilvusException: (code=0, message=the length (564) of 78th string exceeds max length (512)
查找max(len(x) for x in temp_list)之类  都没有超过512过,也没超过256过,不知道哪里的数据有问题..
反复截段文本等测试后发现,例如用len(x)看到的字符串长度是10,但保存进milus的长度,并不是..

举例,把数据库长度设为一个小值16:
FieldSchema(name="question", dtype=DataType.VARCHAR, auto_id=False, max_length=16)

再把数据缩到只有一行 测试结果插入成功:

line contents is : 你好呀你好 and length is 5
Batches: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:01<00:00,  1.02s/it]
index handle result: Status(code=0, message=)
insert result: (insert count: 1, delete count: 0, upsert count: 0, timestamp: 449735609509740549, success count: 1, err count: 0)

再增加一点文字长度 就报错了:

line contents is : 你好呀你好呀 and length is 6
Batches: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00,  1.03it/s]
index handle result: Status(code=0, message=)
[2024-05-13 20:59:27,915 decorators.py:134                              ERROR] RPC error: [batch_insert], <MilvusException: (code=0, message=the length (18) of 0th string exceeds max length (16))>, <Time:{'RPC start': '2024-05-13 20:59:27.912751', 'RPC error': '2024-05-13 20:59:27.915058'}>
Traceback (most recent call last):
  File "/root/temp_dir/run_task.py", line 55, in <module>
    XXX().create_insert_vector_db()
  File "/root/temp_dir/app/service/vector_db/xx_pre_handle.py", line 63, in create_insert_vector_db
    ).get_or_create_db(fields, description, "possible_question_embeddings", entities)
  File "/root/temp_dir/app/service/vector_db/milvus_db.py", line 23, in get_or_create_db
    return self.create_and_insert(fields, description, index_field_name, entities)
  File "/root/temp_dir/app/service/vector_db/milvus_db.py", line 28, in create_and_insert
    self.insert_db(entities)
  File "/root/temp_dir/app/service/vector_db/milvus_db.py", line 40, in insert_db
    insert_result = self.collection.insert(entities)
  File "/root/tmp/venv_dir/1_text_simi/lib/python3.10/site-packages/pymilvus/orm/collection.py", line 497, in insert
    res = conn.batch_insert(
  File "/root/tmp/venv_dir/1_text_simi/lib/python3.10/site-packages/pymilvus/decorators.py", line 135, in handler
    raise e from e
  File "/root/tmp/venv_dir/1_text_simi/lib/python3.10/site-packages/pymilvus/decorators.py", line 131, in handler
    return func(*args, **kwargs)
  File "/root/tmp/venv_dir/1_text_simi/lib/python3.10/site-packages/pymilvus/decorators.py", line 170, in handler
    return func(self, *args, **kwargs)
  File "/root/tmp/venv_dir/1_text_simi/lib/python3.10/site-packages/pymilvus/decorators.py", line 110, in handler
    raise e from e
  File "/root/tmp/venv_dir/1_text_simi/lib/python3.10/site-packages/pymilvus/decorators.py", line 74, in handler
    return func(*args, **kwargs)
  File "/root/tmp/venv_dir/1_text_simi/lib/python3.10/site-packages/pymilvus/client/grpc_handler.py", line 566, in batch_insert
    raise err from err
  File "/root/tmp/venv_dir/1_text_simi/lib/python3.10/site-packages/pymilvus/client/grpc_handler.py", line 560, in batch_insert
    check_status(response.status)
  File "/root/tmp/venv_dir/1_text_simi/lib/python3.10/site-packages/pymilvus/client/utils.py", line 54, in check_status
    raise MilvusException(status.code, status.reason, status.error_code)
pymilvus.exceptions.MilvusException: <MilvusException: (code=0, message=the length (18) of 0th string exceeds max length (16))>


所以,可能是因为UTF-8或其他编码的原因,一些非ASCII字符可能被编码成多个字节 以保存进milvus。
所以,解决方案是 建表时FieldSchema中把max_length 设置为4倍或其他倍数于预期的最大长度。


 

http://www.tj-hxxt.cn/news/119746.html

相关文章:

  • 品牌网站制作短视频运营方案策划书
  • 网站建设新报价图片武汉seo认可搜点网络
  • wordpress 崩溃南宁seo优化公司排名
  • 公司制作网站收费标准推广优化网站排名教程
  • 广东省建设厅官方网站多少钱关键词搜索推广排行榜
  • 男女做暖暖的时候网站全网营销推广怎么做
  • 网页浏览器软件有哪些沈阳企业网站seo公司
  • 做平面设计的一般浏览什么网站搜索排名查询
  • 用wp系统做网站个人介绍网页制作
  • 杭州网站优化排名百度推广登录平台怎么收费
  • remix做歌网站seo网站有哪些
  • 外贸软件定制aso如何优化
  • 有什么网站可以做问卷调查市场营销策划公司
  • dedecms做多语言的网站软文是指什么
  • 常德红网官网网站网络营销的基本职能
  • 布吉附近做网站竞价推广返点开户
  • 建筑工地新型材料模板抖音视频seo霸屏
  • 单机游戏大全搜索引擎的优化和推广
  • 想做个外贸网站合肥正规的seo公司
  • 菠菜网站怎么做推广比较好公司网站seo公司
  • 温州大凯工艺品有限公司英文网站百度seo快速排名优化软件
  • 组织建设是什么网站seo分析报告案例
  • 先做公众号在做网站品牌推广方式都有哪些
  • 南昌企业网站设计公司semi是什么意思
  • wordpress网站搭建教程2023年11月新冠高峰
  • 做网站的公司不会设计网站设计专业的公司
  • 找广网seo研究中心培训机构
  • 大型建设网站制作app平台搭建
  • 给孩子做衣服的网站常用网站推广方法及资源
  • 东营市公司网站建设价格网站域名注册查询