Spaces:
Running
Running
fahmiaziz98
commited on
Commit
·
da0b1f1
1
Parent(s):
2e2b2b3
init
Browse files
src/api/routers/embedding.py
CHANGED
|
@@ -75,10 +75,10 @@ async def create_embeddings(
|
|
| 75 |
HTTPException: On validation or generation errors
|
| 76 |
"""
|
| 77 |
|
| 78 |
-
if isinstance(request.input, str):
|
| 79 |
-
texts = [request.input]
|
| 80 |
-
|
| 81 |
try:
|
|
|
|
|
|
|
|
|
|
| 82 |
kwargs = extract_embedding_kwargs(request)
|
| 83 |
|
| 84 |
model = manager.get_model(request.model)
|
|
@@ -153,10 +153,11 @@ async def create_sparse_embedding(
|
|
| 153 |
Raises:
|
| 154 |
HTTPException: On validation or generation errors
|
| 155 |
"""
|
| 156 |
-
if isinstance(request.input, str):
|
| 157 |
-
texts = [request.input]
|
| 158 |
|
| 159 |
try:
|
|
|
|
|
|
|
|
|
|
| 160 |
kwargs = extract_embedding_kwargs(request)
|
| 161 |
|
| 162 |
model = manager.get_model(request.model)
|
|
|
|
| 75 |
HTTPException: On validation or generation errors
|
| 76 |
"""
|
| 77 |
|
|
|
|
|
|
|
|
|
|
| 78 |
try:
|
| 79 |
+
if isinstance(request.input, str):
|
| 80 |
+
texts = [request.input]
|
| 81 |
+
|
| 82 |
kwargs = extract_embedding_kwargs(request)
|
| 83 |
|
| 84 |
model = manager.get_model(request.model)
|
|
|
|
| 153 |
Raises:
|
| 154 |
HTTPException: On validation or generation errors
|
| 155 |
"""
|
|
|
|
|
|
|
| 156 |
|
| 157 |
try:
|
| 158 |
+
if isinstance(request.input, str):
|
| 159 |
+
texts = [request.input]
|
| 160 |
+
|
| 161 |
kwargs = extract_embedding_kwargs(request)
|
| 162 |
|
| 163 |
model = manager.get_model(request.model)
|