You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All notable changes to this project will be documented in this file.
4
+
5
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+
## [Unreleased]
9
+
10
+
## [1.0.3] - 2023-11-13
11
+
12
+
-[jayxuz](https://github.com/jayxuz) contributed [#5](https://github.com/limcheekin/open-text-embeddings/pull/5): improved OpenAI API compatibility, better support for previous versions of Python (start from v3.7), better defaults and bug fixes.
13
+
- Normalize embeddings enabled by default.
14
+
- Added `VERBOSE` environment variable to support verbose logging, disabled by default.
15
+
- Support `openai` package version >= 1.0.0.
16
+
17
+
## [1.0.2] - 2023-10-11
18
+
19
+
-[#3](https://github.com/limcheekin/open-text-embeddings/issues/3) Added gzip compression to web request and response.
20
+
21
+
## [1.0.1] - 2023-09-27
22
+
23
+
- Fixed readme and package publishing workflow, no changes to code.
24
+
25
+
## [1.0.0] - 2023-09-27
26
+
27
+
- Initial release 🎉
28
+
-[Vokturz](https://github.com/Vokturz) contributed [#2](https://github.com/limcheekin/open-text-embeddings/pull/2): support for CPU/GPU choice and initialization before starting the app.
Copy file name to clipboardExpand all lines: README.md
+38-9Lines changed: 38 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,26 @@ Below is a compilation of open-source models that are tested via the `embeddings
20
20
21
21
The models mentioned above have undergone testing and verification. It is worth noting that all sentence-transformers models are expected to perform seamlessly with the endpoint.
22
22
23
+
It may not be immediately apparent that utilizing the `BAAI/bge-*` and `intfloat/e5-*` series of models with the `embeddings` endpoint can yield different embeddings for the same `input` value, depending on how it is sent to the `embeddings` endpoint. Consider the following examples:
24
+
25
+
**Example 1:**
26
+
27
+
```json
28
+
{
29
+
"input": "The food was delicious and the waiter..."
30
+
}
31
+
```
32
+
33
+
**Example 2:**
34
+
35
+
```json
36
+
{
37
+
"input": ["The food was delicious and the waiter..."]
38
+
}
39
+
```
40
+
41
+
This discrepancy arises because the `BAAI/bge-*` and `intfloat/e5-*` series of models require the addition of specific prefix text to the `input` value before creating embeddings to achieve optimal performance. In the first example, where the `input` is of type `str`, it is assumed that the embeddings will be used for queries. Conversely, in the second example, where the `input` is of type `List[str]`, it is assumed that you will store the embeddings in a vector database. Adhering to these guidelines is essential to ensure the intended functionality and optimal performance of the models.
42
+
23
43
## 🔍 Demo
24
44
25
45
Try out open-text-embeddings in your browser:
@@ -36,27 +56,39 @@ To run the embeddings endpoint locally as a standalone FastAPI server, follow th
2. Run the server with the desired model using the following command which enabled normalize embeddings (Omit the `NORMALIZE_EMBEDDINGS` if the model don't support normalize embeddings):
59
+
2. Run the server with the desired model using the following command which normalize embeddings is enabled by default:
If a GPU is detected in the runtime environment, the server will automatically execute using the `cuba` mode. However, you have the flexibility to specify the `DEVICE` environment variable to choose between `cpu` and `cuba`. Here's an example of how to run the server with your desired configuration:
This setup allows you to seamlessly switch between CPU and GPU modes, giving you control over the server's performance based on your specific requirements.
52
78
79
+
You can enabled verbose logging by setting the `VERBOSE` to `1`, for example:
3. You will see the following text from your console once the server has started:
54
86
55
87
```bash
56
88
INFO: Started server process [19705]
57
89
INFO: Waiting for application startup.
58
90
INFO: Application startup complete.
59
-
INFO: Uvicorn running on http://localhost:8000 (Press CTRL+C to quit)
91
+
INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
60
92
```
61
93
62
94
## ☁️ AWS Lambda Function
@@ -65,7 +97,7 @@ To deploy the embeddings endpoint as an AWS Lambda Function using GitHub Actions
65
97
66
98
1.[Fork](https://github.com/limcheekin/open-text-embeddings/fork) the repo.
67
99
68
-
2. Add your AWS credentials (`AWS_KEY` and `AWS_SECRET`) to the repository secrets. You can do this by navigating to https://github.com/username/open-text-embeddings/settings/secrets/actions.
100
+
2. Add your AWS credentials (`AWS_KEY` and `AWS_SECRET`) to the repository secrets. You can do this by navigating to https://github.com/<your-username>/open-text-embeddings/settings/secrets/actions.
69
101
70
102
3. Manually trigger the `Deploy Dev` or `Remove Dev` GitHub Actions to deploy or remove the AWS Lambda Function.
71
103
@@ -83,10 +115,6 @@ To get started:
83
115
84
116
2. Execute the cells in the notebook to test the embeddings endpoint.
85
117
86
-
## ❓ Known Issues
87
-
88
-
1. Gzip compression for web request doesn't seems working in AWS Lambda Function.
89
-
90
118
## 🧑💼 Contributing
91
119
92
120
Contributions are welcome! Please check out the issues on the repository, and feel free to open a pull request.
@@ -99,6 +127,7 @@ For more information, please see the [contributing guidelines](CONTRIBUTING.md).
99
127
Thank you very much for the following contributions:
100
128
101
129
-[Vokturz](https://github.com/Vokturz) contributed [#2](https://github.com/limcheekin/open-text-embeddings/pull/2): support for CPU/GPU choice and initialization before starting the app.
130
+
-[jayxuz](https://github.com/jayxuz) contributed [#5](https://github.com/limcheekin/open-text-embeddings/pull/5): improved OpenAI API compatibility, better support for previous versions of Python (start from v3.7), better defaults and bug fixes.
[#3](https://github.com/limcheekin/open-text-embeddings/issues/3) Added gzip compression to web request and response.
1
+
-[jayxuz](https://github.com/jayxuz) contributed [#5](https://github.com/limcheekin/open-text-embeddings/pull/5): improved OpenAI API compatibility, better support for previous versions of Python (start from v3.7), better defaults and bug fixes.
2
+
- Normalize embeddings enabled by default.
3
+
- Added `VERBOSE` environment variable to support verbose logging, disabled by default.
0 commit comments