Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -53,28 +53,11 @@ def create_combined_text(item):
|
|
53 |
|
54 |
|
55 |
|
56 |
-
embeddings = []
|
57 |
|
58 |
@app.get("/gen")
|
59 |
def root():
|
60 |
# Prepare Data
|
61 |
-
data = []
|
62 |
-
for item in dataset:
|
63 |
-
data.append({
|
64 |
-
"product_name": item["product_name"],
|
65 |
-
"sub_category": item["sub_category"],
|
66 |
-
"salt_composition": item["salt_composition"],
|
67 |
-
"product_price": item["product_price"],
|
68 |
-
"product_manufactured": item["product_manufactured"],
|
69 |
-
"medicine_desc": item["medicine_desc"],
|
70 |
-
"side_effects": item["side_effects"],
|
71 |
-
"drug": item["drug"],
|
72 |
-
"brand": item["brand"],
|
73 |
-
"effect": item["effect"],
|
74 |
-
})
|
75 |
-
texts = [create_combined_text(item) for item in data]
|
76 |
-
print("Converted Into Text")
|
77 |
-
embeddings = model.encode(texts, convert_to_tensor=True)
|
78 |
return {"message": "Welcome to the medicine Search API!"}
|
79 |
|
80 |
@app.get("/meds")
|
|
|
53 |
|
54 |
|
55 |
|
56 |
+
embeddings = dataset["embeddings"]
|
57 |
|
58 |
@app.get("/gen")
|
59 |
def root():
|
60 |
# Prepare Data
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
return {"message": "Welcome to the medicine Search API!"}
|
62 |
|
63 |
@app.get("/meds")
|