Spaces:
Sleeping
Sleeping
Commit ·
e64befc
1
Parent(s): 1c2c99e
Update main.py
Browse files
main.py
CHANGED
|
@@ -2,7 +2,7 @@ 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,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
|
|
|
|
| 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',cache_folder="/app/yo")
|
| 17 |
|
| 18 |
class StringInput(BaseModel):
|
| 19 |
sentence1: str
|