Spaces:
Sleeping
Sleeping
Vela commited on
Commit ·
40b1f16
1
Parent(s): 78cb0b1
added home page end point
Browse files- __pycache__/main.cpython-312.pyc +0 -0
- main.py +5 -2
__pycache__/main.cpython-312.pyc
CHANGED
|
Binary files a/__pycache__/main.cpython-312.pyc and b/__pycache__/main.cpython-312.pyc differ
|
|
|
main.py
CHANGED
|
@@ -6,9 +6,12 @@ from sentence_transformers import util
|
|
| 6 |
|
| 7 |
app = FastAPI()
|
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
@app.get("/embeddings")
|
| 10 |
-
def display_embedding(
|
| 11 |
-
message = prediction.message
|
| 12 |
embedding = models.get_embedding(message)
|
| 13 |
dimension = len(embedding)
|
| 14 |
return {"Dimension" : {dimension : embedding.tolist()}}
|
|
|
|
| 6 |
|
| 7 |
app = FastAPI()
|
| 8 |
|
| 9 |
+
@app.get("/")
|
| 10 |
+
def home_page():
|
| 11 |
+
return {"Home": "Welcome to prediction hub"}
|
| 12 |
+
|
| 13 |
@app.get("/embeddings")
|
| 14 |
+
def display_embedding(message : str = "Hello guys enter a text to get embeddings"):
|
|
|
|
| 15 |
embedding = models.get_embedding(message)
|
| 16 |
dimension = len(embedding)
|
| 17 |
return {"Dimension" : {dimension : embedding.tolist()}}
|