Skip to content

Commit c1bb2c1

Browse files
committed
docs: added changelog, updated readme, release note, version and clean up for release 1.0.3
1 parent 8b33167 commit c1bb2c1

File tree

6 files changed

+73
-267
lines changed

6 files changed

+73
-267
lines changed

.github/workflows/dev.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,5 @@ jobs:
4747
run: echo $(cat endpoint)
4848
- name: Test Lambda functions
4949
run: |
50-
"curl -X POST -H 'Content-Type: application/json' -d @text.json $(cat endpoint)v1/embeddings"
51-
"./test.sh $(cat endpoint)v1/embeddings"
50+
curl -X POST -H 'Content-Type: application/json' -d @text.json $(cat endpoint)v1/embeddings
51+
./test.sh $(cat endpoint)v1/embeddings

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Changelog
2+
3+
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.

README.md

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,26 @@ Below is a compilation of open-source models that are tested via the `embeddings
2020

2121
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.
2222

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+
2343
## 🔍 Demo
2444

2545
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
3656
pip install --no-cache-dir open-text-embeddings[server]
3757
```
3858

39-
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:
4060

4161
```bash
42-
MODEL=intfloat/e5-large-v2 NORMALIZE_EMBEDDINGS=1 python -m open.text.embeddings.server
62+
MODEL=intfloat/e5-large-v2 python -m open.text.embeddings.server
63+
```
64+
65+
Set the `NORMALIZE_EMBEDDINGS` to `0` or `False` if the model doesn't support normalize embeddings, for example:
66+
67+
```bash
68+
MODEL=intfloat/e5-large-v2 NORMALIZE_EMBEDDINGS=0 python -m open.text.embeddings.server
4369
```
4470

4571
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:
4672

4773
```bash
48-
MODEL=intfloat/e5-large-v2 NORMALIZE_EMBEDDINGS=1 DEVICE=cpu python -m open.text.embeddings.server
74+
MODEL=intfloat/e5-large-v2 DEVICE=cpu python -m open.text.embeddings.server
4975
```
5076

5177
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.
5278

79+
You can enabled verbose logging by setting the `VERBOSE` to `1`, for example:
80+
81+
```bash
82+
MODEL=intfloat/e5-large-v2 VERBOSE=1 python -m open.text.embeddings.server
83+
```
84+
5385
3. You will see the following text from your console once the server has started:
5486

5587
```bash
5688
INFO: Started server process [19705]
5789
INFO: Waiting for application startup.
5890
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)
6092
```
6193

6294
## ☁️ AWS Lambda Function
@@ -65,7 +97,7 @@ To deploy the embeddings endpoint as an AWS Lambda Function using GitHub Actions
6597

6698
1. [Fork](https://github.com/limcheekin/open-text-embeddings/fork) the repo.
6799

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.
69101

70102
3. Manually trigger the `Deploy Dev` or `Remove Dev` GitHub Actions to deploy or remove the AWS Lambda Function.
71103

@@ -83,10 +115,6 @@ To get started:
83115

84116
2. Execute the cells in the notebook to test the embeddings endpoint.
85117

86-
## ❓ Known Issues
87-
88-
1. Gzip compression for web request doesn't seems working in AWS Lambda Function.
89-
90118
## 🧑‍💼 Contributing
91119

92120
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).
99127
Thank you very much for the following contributions:
100128

101129
- [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.
102131

103132
## 📔 License
104133

RELEASE.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
1.0.2 released.
2-
3-
[#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.
4+
- Support `openai` package version >= 1.0.0.

aws-lambda-embeddings.ipynb

Lines changed: 0 additions & 252 deletions
This file was deleted.

0 commit comments

Comments
 (0)