dazpye commited on
Commit
4280311
·
verified ·
1 Parent(s): 3c066bf

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +2 -2
handler.py CHANGED
@@ -1,7 +1,7 @@
1
  import torch
2
  from transformers import CLIPProcessor, CLIPModel
3
 
4
- class ModelHandler:
5
  def __init__(self):
6
  # Load model and processor
7
  self.model = CLIPModel.from_pretrained("dazpye/clip-image")
@@ -23,7 +23,7 @@ class ModelHandler:
23
  # Convert output to readable format
24
  return {"predictions": inference_output}
25
 
26
- handler = ModelHandler()
27
 
28
  def handle(request):
29
  inputs = request if isinstance(request, dict) else request.json()
 
1
  import torch
2
  from transformers import CLIPProcessor, CLIPModel
3
 
4
+ class EndpointHandler:
5
  def __init__(self):
6
  # Load model and processor
7
  self.model = CLIPModel.from_pretrained("dazpye/clip-image")
 
23
  # Convert output to readable format
24
  return {"predictions": inference_output}
25
 
26
+ handler = EndpointHandler()
27
 
28
  def handle(request):
29
  inputs = request if isinstance(request, dict) else request.json()