Amitai Getzler
commited on
Commit
•
6d8b6f3
1
Parent(s):
736c00c
:heavy_plus_sign: Add
Browse files- __pycache__/handler.cpython-312.pyc +0 -0
- handler.py +2 -2
- test.py +1 -1
__pycache__/handler.cpython-312.pyc
CHANGED
Binary files a/__pycache__/handler.cpython-312.pyc and b/__pycache__/handler.cpython-312.pyc differ
|
|
handler.py
CHANGED
@@ -10,9 +10,9 @@ from typing import Dict, Any
|
|
10 |
class EndpointHandler:
|
11 |
def __init__(self, path="hf-hub:Styld/marqo-fashionSigLIP"):
|
12 |
self.model, self.preprocess_train, self.preprocess_val = (
|
13 |
-
open_clip.create_model_and_transforms(
|
14 |
)
|
15 |
-
self.tokenizer = open_clip.get_tokenizer(
|
16 |
|
17 |
def classify_image(self, candidate_labels, image):
|
18 |
def get_top_prediction(text_probs, labels):
|
|
|
10 |
class EndpointHandler:
|
11 |
def __init__(self, path="hf-hub:Styld/marqo-fashionSigLIP"):
|
12 |
self.model, self.preprocess_train, self.preprocess_val = (
|
13 |
+
open_clip.create_model_and_transforms("hf-hub:Styld/marqo-fashionSigLIP")
|
14 |
)
|
15 |
+
self.tokenizer = open_clip.get_tokenizer("hf-hub:Styld/marqo-fashionSigLIP")
|
16 |
|
17 |
def classify_image(self, candidate_labels, image):
|
18 |
def get_top_prediction(text_probs, labels):
|
test.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
from handler import EndpointHandler
|
2 |
|
3 |
# init handler
|
4 |
-
my_handler = EndpointHandler(
|
5 |
|
6 |
# prepare sample payload
|
7 |
embedding_input = {
|
|
|
1 |
from handler import EndpointHandler
|
2 |
|
3 |
# init handler
|
4 |
+
my_handler = EndpointHandler()
|
5 |
|
6 |
# prepare sample payload
|
7 |
embedding_input = {
|