Commit ·
f1da700
1
Parent(s): c38370d
/embed tested
Browse files58 unmodified lines596061626364656658 unmodified linestry:if req.model:model = load_model(req.model)else:embeddings = default_model.encode(req.texts, convert_to_numpy=True, normalize_embeddings=True)return {"embeddings": embeddings.tolist()}except Exception as e:raise HTTPException(status_code=500, detail=str(e))58 unmodified lines59606162636465666758 unmodified linestry:if req.model:model = load_model(req.model)embeddings = model.encode(req.texts, convert_to_numpy=True, normalize_embeddings=True)else:embeddings = default_model.encode(req.texts, convert_to_numpy=True, normalize_embeddings=True)return {"embeddings": embeddings.tolist()}except Exception as e:raise HTTPException(status_code=500, detail=str(e))
main.py+2-1