+ **CPU Compatibility:** GGML models could run on CPUs, broadening accessibility.
-
Cons
- Limited Flexibility: GGML struggled with adding extra information about the model.
- Compatibility Issues: Introduction of new features often led to compatibility problems with older models.
- Manual Adjustments Required: Users frequently had to modify settings like rope-freq-base, rope-freq-scale, gqa, and rms-norm-eps, which could be complex.
GGUF
GGUF (GPT-Generated Unified Format), introduced as a successor to GGML (GPT-Generated Model Language), was released on the 21st of August, 2023. This format represents a significant step forward in the field of language model file formats, facilitating enhanced storage and processing of large language models like GPT.
-
Pros
- Addresses GGML Limitations: GGUF is designed to overcome GGML’s shortcomings and enhance user experience.
- Extensibility: It allows for the addition of new features while maintaining compatibility with older models.
- Stability: GGUF focuses on eliminating breaking changes, easing the transition to newer versions.
- Versatility: Supports various models, extending beyond the scope of llama models.
-
Cons
- Transition Time: Converting existing models to GGUF may require significant time.
- Adaptation Required: Users and developers must become accustomed to this new format.
Embedding
概念
Embedding 嵌入是一种机器学习概念,用于将数据映射到高维空间中,在高维空间中,相似语义的数据被放置在一起
Embedding Model 【嵌入模型】
- 通常是来自BERT或其他Transformer家族的深度神经网络
- 可以用一系列称为向量的数字有效地表示文本、图像和其他数据类型的语义。
- 关键特征是在高维空间中向量之间的数学距离可以表示原始文本或图像的语义相似性。
分类
-
Dense embedding:是一种用于自然语言处理的技术,用于将单词或短语表示为高维空间中的连续、稠密向量,捕获语义关系
- 大多数嵌入模型将信息表示为数百到数千维的浮点向量。
- 输出: 稠密向量,因为大多数维度具有非零值。
- 如 流行的开源嵌入模型
BAAI/ big -base-en-v1.5
输出768个浮点数的向量(768维浮点向量)。
-
Sparse embedding:使用大多数元素为零的向量表示单词或短语,只有一个非零元素表示词汇表中特定单词的存在。它是高效和可解释的,使它们适合于精确的术语匹配相关的任务
- 通常具有更高的维度(数万或更多),这取决于token vocabulary【词汇表】的大小
- 输出: 稀疏向量,因为大多数维度的值是0。
- 通过如下两种方式生成:
- 通过深度神经网络生成
- 通过对文本语料库的统计分析生成
- 由于其可解释性和更好的域外泛化能力,稀疏嵌入越来越多地被开发人员采用,作为密集嵌入的补充
-
常用的Embedding函数
Embedding Function | Type | API or Open-sourced |
---|---|---|
openai | Dense | API |
sentence-transformer | Dense | Open-sourced |
bm25 | Sparse | Open-sourced |
Splade | Sparse | Open-sourced |
bge-m3 | Hybrid | Open-sourced |
术语
Llamaindex
LlamaIndex is the leading data framework for building LLM applications
LlamaCPP
LlamaCPP: Inference of Meta’s LLaMA model (and others) in pure C/C++,是一个基于Meta公司的LLaMA模型的纯C/C++版本的推理框架。它主要用于模型推理
主要支持的是Meta公司的LLaMA系列模型,如LLaMA 2、Code Llama、Falcon、Baichuan等。这些模型都是基于LLaMA架构的,并且经过特定的格式转换(如转换为gguf格式)后,才能在LlamaCPP中进行推理。
想要使用LlamaCPP进行模型推理,需要确保你选择的模型是LLaMA系列的,并且已经转换为LlamaCPP所支持的格式
The main goal of llama.cpp
is to enable LLM inference with minimal setup and state-of-the-art performance on a wide variety of hardware - locally and in the cloud.
Poetry
PoetryPython packaging and dependency management tool
Poetry可以帮助您声明、管理和安装Python项目的依赖项,确保您在任何地方都有正确的堆栈。
ASGI
ASGI(Asynchronous Server Gateway Interface)是一种 Python 异步 Web 服务器和应用程序之间通信的接口标准。与传统的 WSGI(Web Server Gateway Interface)相比,ASGI 更适用于高并发和实时性要求高的应用程序,例如聊天应用、实时通知、在线游戏等。
- Django ASGI 是 Django 框架的 ASGI 版本,它允许 Django 应用程序以异步方式处理请求和响应。
- uvicorn: an ASGI web server implementation for Python.
- Hypercorn is an ASGI web server based on the sans-io hyper, h11, h2, and wsproto libraries and inspired by Gunicorn. Hypercorn supports HTTP/1, HTTP/2, WebSockets (over HTTP/1 and HTTP/2), ASGI/2, and ASGI/3 specifications. Hypercorn can utilise asyncio, uvloop, or trio worker types.
FastAPI
FastAPI is a modern, fast (high-performance), web framework for building APIs with Python 3.8+ based on standard Python type hints.
Chroma
Chroma is the open-source embedding database. Chroma makes it easy to build LLM apps by making knowledge, facts, and skills pluggable for LLMs.
Chroma的目标是帮助用户更加便捷地构建大模型应用,更加轻松的将知识(knowledge)、事实(facts)和技能(skills)等我们现实世界中的文档整合进大模型中。
Chroma提供的工具:
- 存储文档数据和它们的元数据:store embeddings and their metadata
- 嵌入和查询:embed documents and queries
- 搜索: search embeddings
Chroma的设计优先考虑:
- 足够简单并且提升开发者效率:simplicity and developer productivity
- 搜索之上再分析:analysis on top of search
- 追求快(性能): it also happens to be very quick
Qdrant
Qdrant一个开源的相似性搜索引擎,专注于高效处理向量数据。它不仅提供了快速的相似性搜索能力,还支持向量的实时插入和删除,使其在实时场景中也能发挥重要作用。其设计旨在解决大规模向量数据检索的问题,例如图像、文本和其他复杂数据类型。
自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。
深知大多数Python工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则几千的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!
因此收集整理了一份《2024年Python开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上前端开发知识点,真正体系化!
由于文件比较大,这里只是将部分目录大纲截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且后续会持续更新
如果你觉得这些内容对你有帮助,可以扫码获取!!!(备注:Python)
习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上前端开发知识点,真正体系化!**
由于文件比较大,这里只是将部分目录大纲截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且后续会持续更新
如果你觉得这些内容对你有帮助,可以扫码获取!!!(备注:Python)