ffreemt commited on
Commit
0e167ee
1 Parent(s): 7f5a78c

Update os.environ["HF_HOME"]="/tmp/cache"

Browse files
Files changed (2) hide show
  1. Dockerfile +0 -1
  2. m3_server.py +3 -0
Dockerfile CHANGED
@@ -22,5 +22,4 @@ RUN pip install --no-cache-dir --upgrade pip && \
22
  # CMD ["python", "app.py"]
23
 
24
  # CMD ["sh", "start-m3-server.sh"]
25
-
26
  CMD ["python", "m3_server.py"]
 
22
  # CMD ["python", "app.py"]
23
 
24
  # CMD ["sh", "start-m3-server.sh"]
 
25
  CMD ["python", "m3_server.py"]
m3_server.py CHANGED
@@ -1,3 +1,4 @@
 
1
  import asyncio
2
  import time
3
  from concurrent.futures import ThreadPoolExecutor
@@ -10,6 +11,8 @@ from FlagEmbedding import BGEM3FlagModel
10
  from pydantic import BaseModel
11
  from starlette.status import HTTP_504_GATEWAY_TIMEOUT
12
 
 
 
13
  batch_size = 2 # gpu batch_size in order of your available vram
14
  max_request = 10 # max request for future improvements on api calls / gpu batches (for now is pretty basic)
15
  max_length = 5000 # max context length for embeddings and passages in re-ranker
 
1
+ impor os
2
  import asyncio
3
  import time
4
  from concurrent.futures import ThreadPoolExecutor
 
11
  from pydantic import BaseModel
12
  from starlette.status import HTTP_504_GATEWAY_TIMEOUT
13
 
14
+ os.environ["HF_HOME"] = "/tmp/cache"
15
+
16
  batch_size = 2 # gpu batch_size in order of your available vram
17
  max_request = 10 # max request for future improvements on api calls / gpu batches (for now is pretty basic)
18
  max_length = 5000 # max context length for embeddings and passages in re-ranker