Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,7 +14,7 @@ app = FastAPI()
|
|
| 14 |
# Check for GPU and load model accordingly
|
| 15 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 16 |
model_name = os.getenv("MODEL_NAME")
|
| 17 |
-
model = SentenceTransformer(model_name, device=device)
|
| 18 |
|
| 19 |
# Define the embedding endpoint
|
| 20 |
@app.post("/embed")
|
|
|
|
| 14 |
# Check for GPU and load model accordingly
|
| 15 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 16 |
model_name = os.getenv("MODEL_NAME")
|
| 17 |
+
model = SentenceTransformer(model_name, device=device, trust_remote_code=True)
|
| 18 |
|
| 19 |
# Define the embedding endpoint
|
| 20 |
@app.post("/embed")
|