Fix typos in python code
Browse files
README.md
CHANGED
@@ -2609,7 +2609,9 @@ library_name: transformers
|
|
2609 |
|
2610 |
Sionic AI delivers more accessible and cost-effective AI technology addressing the various needs to boost productivity and drive innovation.
|
2611 |
|
2612 |
-
The Large Language Model (LLM) is not for research and experimentation.
|
|
|
|
|
2613 |
|
2614 |
## How to get embeddings
|
2615 |
|
@@ -2664,7 +2666,12 @@ Response:
|
|
2664 |
|
2665 |
### Python code Example
|
2666 |
Get embeddings by directly calling Sionic's embedding API.
|
|
|
2667 |
```python
|
|
|
|
|
|
|
|
|
2668 |
def get_embedding(queries: List[str], url):
|
2669 |
response = requests.post(url=url, json={'inputs': queries})
|
2670 |
return np.asarray(response.json()['embedding'], dtype=np.float32)
|
@@ -2685,7 +2692,7 @@ from model_api import SionicEmbeddingModel
|
|
2685 |
|
2686 |
inputs1 = ["first query", "second query"]
|
2687 |
inputs2 = ["third query", "fourth query"]
|
2688 |
-
model
|
2689 |
dimension=2048)
|
2690 |
embedding1 = model.encode(inputs1)
|
2691 |
embedding2 = model.encode(inputs2)
|
@@ -2701,7 +2708,7 @@ from model_api import SionicEmbeddingModel
|
|
2701 |
|
2702 |
query = ["first query", "second query"]
|
2703 |
passage = ["This is a passage related to the first query", "This is a passage related to the second query"]
|
2704 |
-
model
|
2705 |
instruction="query: ",
|
2706 |
dimension=2048)
|
2707 |
query_embedding = model.encode_queries(query)
|
|
|
2609 |
|
2610 |
Sionic AI delivers more accessible and cost-effective AI technology addressing the various needs to boost productivity and drive innovation.
|
2611 |
|
2612 |
+
The Large Language Model (LLM) is not for research and experimentation.
|
2613 |
+
We offer solutions that leverage LLM to add value to your business.
|
2614 |
+
Anyone can easily train and control AI.
|
2615 |
|
2616 |
## How to get embeddings
|
2617 |
|
|
|
2666 |
|
2667 |
### Python code Example
|
2668 |
Get embeddings by directly calling Sionic's embedding API.
|
2669 |
+
|
2670 |
```python
|
2671 |
+
from typing import List
|
2672 |
+
import numpy as np
|
2673 |
+
import requests
|
2674 |
+
|
2675 |
def get_embedding(queries: List[str], url):
|
2676 |
response = requests.post(url=url, json={'inputs': queries})
|
2677 |
return np.asarray(response.json()['embedding'], dtype=np.float32)
|
|
|
2692 |
|
2693 |
inputs1 = ["first query", "second query"]
|
2694 |
inputs2 = ["third query", "fourth query"]
|
2695 |
+
model = SionicEmbeddingModel(url="https://api.sionic.ai/v1/embedding",
|
2696 |
dimension=2048)
|
2697 |
embedding1 = model.encode(inputs1)
|
2698 |
embedding2 = model.encode(inputs2)
|
|
|
2708 |
|
2709 |
query = ["first query", "second query"]
|
2710 |
passage = ["This is a passage related to the first query", "This is a passage related to the second query"]
|
2711 |
+
model = SionicEmbeddingModel(url="https://api.sionic.ai/v1/embedding",
|
2712 |
instruction="query: ",
|
2713 |
dimension=2048)
|
2714 |
query_embedding = model.encode_queries(query)
|