tcm03
commited on
Commit
·
941ce80
1
Parent(s):
9d5aba6
Update imports for HF inference endpoint
Browse files- handler.py +2 -3
- inference.py +4 -1
handler.py
CHANGED
@@ -6,10 +6,9 @@ import os
|
|
6 |
from io import BytesIO
|
7 |
import json
|
8 |
|
9 |
-
from pathlib import Path
|
10 |
-
CODE_PATH = Path('code/')
|
11 |
import sys
|
12 |
-
|
|
|
13 |
from clip.model import CLIP
|
14 |
from clip.clip import _transform, tokenize
|
15 |
|
|
|
6 |
from io import BytesIO
|
7 |
import json
|
8 |
|
|
|
|
|
9 |
import sys
|
10 |
+
CODE_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), "code")
|
11 |
+
sys.path.append(CODE_PATH)
|
12 |
from clip.model import CLIP
|
13 |
from clip.clip import _transform, tokenize
|
14 |
|
inference.py
CHANGED
@@ -4,8 +4,11 @@ import base64
|
|
4 |
from io import BytesIO
|
5 |
import json
|
6 |
import sys
|
|
|
7 |
|
8 |
-
sys
|
|
|
|
|
9 |
from clip.model import CLIP
|
10 |
from clip.clip import _transform, tokenize
|
11 |
|
|
|
4 |
from io import BytesIO
|
5 |
import json
|
6 |
import sys
|
7 |
+
import os
|
8 |
|
9 |
+
import sys
|
10 |
+
CODE_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), "code")
|
11 |
+
sys.path.append(CODE_PATH)
|
12 |
from clip.model import CLIP
|
13 |
from clip.clip import _transform, tokenize
|
14 |
|