Spaces:
Sleeping
Sleeping
Commit ·
7217c23
1
Parent(s): efb7a35
Update main.py
Browse files
main.py
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
import os
|
| 2 |
-
cwd = os.getcwd()
|
| 3 |
-
cachedir = cwd+'/cache'
|
| 4 |
-
os.mkdir(cachedir)
|
| 5 |
-
os.environ['TRANSFORMERS_CACHE'] =
|
| 6 |
from fastapi import FastAPI, HTTPException
|
| 7 |
import uvicorn
|
| 8 |
from fastapi.middleware.cors import CORSMiddleware
|
|
@@ -13,7 +13,7 @@ app = FastAPI()
|
|
| 13 |
|
| 14 |
|
| 15 |
# Load the SentenceTransformer model
|
| 16 |
-
model = SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2'
|
| 17 |
|
| 18 |
class StringInput(BaseModel):
|
| 19 |
sentence1: str
|
|
|
|
| 1 |
import os
|
| 2 |
+
# cwd = os.getcwd()
|
| 3 |
+
# cachedir = cwd+'/cache'
|
| 4 |
+
# os.mkdir(cachedir)
|
| 5 |
+
os.environ['TRANSFORMERS_CACHE'] = "/app/yo/cache"
|
| 6 |
from fastapi import FastAPI, HTTPException
|
| 7 |
import uvicorn
|
| 8 |
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
| 13 |
|
| 14 |
|
| 15 |
# Load the SentenceTransformer model
|
| 16 |
+
model = SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2')
|
| 17 |
|
| 18 |
class StringInput(BaseModel):
|
| 19 |
sentence1: str
|