Skip to content

Commit 1be3c27

Browse files
authored
Update README.md
1 parent 19bf43c commit 1be3c27

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

README.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# vector-embedding-api
2-
Flask API server for generating text embeddings using OpenAI's "text-embedding-ada-002" model or the Sentence Transformers library.
2+
Flask API server for generating text embeddings using [OpenAI's embedding model](https://platform.openai.com/docs/guides/embeddings) or the [SentenceTransformers](https://www.sbert.net/) library. SentenceTransformers supports over 500 models via [HuggingFace Hub](https://huggingface.co/sentence-transformers).
33

44
## Features 🎯
55
* POST endpoint access to text embedding models
@@ -9,11 +9,11 @@ Flask API server for generating text embeddings using OpenAI's "text-embedding-a
99
* Simple integration with other applications
1010

1111
### Installation 💻
12-
To run this Flask server locally, follow the steps below:
12+
To run this server locally, follow the steps below:
1313

1414
**Clone the repository:** 📦
1515
```bash
16-
git clone https://github.com/your-username/text-embeddings-server.git
16+
git clone https://github.com/deadbits/vector-embedding-api.git
1717
cd text-embeddings-server
1818
```
1919

@@ -28,18 +28,17 @@ source venv/bin/activate
2828
pip install -r requirements.txt
2929
```
3030

31-
3231
### Usage
33-
Before running the server, make sure you have obtained an API key from OpenAI to use their "text-embedding-ada-002" model. Additionally, you need to specify the Sentence Transformers model you want to use in the server.conf file.
32+
Before running the server, make sure you have obtained an API key from OpenAI to use their model. You also need to set the SentenceTransformers model you want to use in the [server.conf](/server.conf) file.
3433

3534
**Modify the server.conf configuration file:** ⚙️
3635
```ini
3736
[main]
3837
openai_api_key = YOUR_OPENAI_API_KEY
39-
sent_transformers_model = YOUR_SENTENCE_TRANSFORMERS_MODEL_NAME
38+
sent_transformers_model = sentence-transformers/all-MiniLM-L6-v2
4039
```
4140

42-
**Start the Flask server:** 🚀
41+
**Start the server:** 🚀
4342
```
4443
python server.py
4544
```
@@ -52,17 +51,15 @@ The server provides the following endpoint:
5251

5352
#### POST /submit
5453
Submit text to be converted to embeddings.
55-
The default is to use the sentence transformers model.
56-
Setting the `ada` field to True will use the OpenAI model
57-
54+
The default is to use the SentenceTransformers model.
55+
Setting the `ada` field to True will use the OpenAI model.
5856

5957
**Example Request:**
6058
```bash
61-
curl -X POST -H "Content-Type: application/json" -d '{"text": "This is an example text.", "ada": true}' http://127.0.0.1:5000/submit
59+
curl -X POST -H "Content-Type: application/json" -d '{'text': 'Put your text here', "ada": true}' http://127.0.0.1:5000/submit
6260
```
6361

6462
**Example Response:**
65-
6663
```json
6764
{
6865
"embedding": [0.123, 0.456, ..., 0.789],

0 commit comments

Comments
 (0)