Utk113Raj commited on
Commit
2fff0ab
·
verified ·
1 Parent(s): e24e7f4

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +4 -1
handler.py CHANGED
@@ -3,7 +3,10 @@ from gliner import GLiNER
3
  class EndpointHandler:
4
  def __init__(self, path=""):
5
  # Use the provided path for loading the model
6
- self.model = GLiNER.from_pretrained(path)
 
 
 
7
 
8
  def __call__(self, data):
9
  # If data is wrapped in 'inputs' (as Hugging Face does), unwrap it
 
3
  class EndpointHandler:
4
  def __init__(self, path=""):
5
  # Use the provided path for loading the model
6
+ self.model = GLiNER.from_pretrained(
7
+ path,
8
+ device_map="cuda"
9
+ )
10
 
11
  def __call__(self, data):
12
  # If data is wrapped in 'inputs' (as Hugging Face does), unwrap it