Spaces:
Sleeping
Sleeping
Vela
commited on
Commit
·
a07193f
1
Parent(s):
198d7d1
updated main.py file
Browse files- __pycache__/main.cpython-312.pyc +0 -0
- __pycache__/models.cpython-312.pyc +0 -0
- main.py +1 -2
__pycache__/main.cpython-312.pyc
CHANGED
Binary files a/__pycache__/main.cpython-312.pyc and b/__pycache__/main.cpython-312.pyc differ
|
|
__pycache__/models.cpython-312.pyc
CHANGED
Binary files a/__pycache__/models.cpython-312.pyc and b/__pycache__/models.cpython-312.pyc differ
|
|
main.py
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
from fastapi import FastAPI
|
2 |
import models
|
3 |
-
import numpy as np
|
4 |
from schema import Prediction
|
5 |
from sentence_transformers import util
|
6 |
|
@@ -17,7 +16,7 @@ def display_embedding(message : str = "Hello guys enter a text to get embeddings
|
|
17 |
dimension = len(embedding)
|
18 |
return {"Dimension" : {dimension : embedding.tolist()}}
|
19 |
except Exception as e:
|
20 |
-
return {f"Unable to fetch the embeddings. Error
|
21 |
|
22 |
@app.post("/prediction")
|
23 |
def display_prediction(prediction : Prediction):
|
|
|
1 |
from fastapi import FastAPI
|
2 |
import models
|
|
|
3 |
from schema import Prediction
|
4 |
from sentence_transformers import util
|
5 |
|
|
|
16 |
dimension = len(embedding)
|
17 |
return {"Dimension" : {dimension : embedding.tolist()}}
|
18 |
except Exception as e:
|
19 |
+
return {f"Unable to fetch the embeddings. Error :{e}" }
|
20 |
|
21 |
@app.post("/prediction")
|
22 |
def display_prediction(prediction : Prediction):
|