Update handler.py
Browse files- handler.py +3 -3
handler.py
CHANGED
|
@@ -6,15 +6,15 @@ from transformers.image_utils import to_numpy_array, PILImageResampling, Channel
|
|
| 6 |
from transformers.image_transforms import resize, to_channel_dimension_format
|
| 7 |
|
| 8 |
class EndpointHandler:
|
| 9 |
-
def __init__(self, model_path: str
|
| 10 |
self.device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 11 |
self.processor = AutoProcessor.from_pretrained(
|
| 12 |
model_path,
|
| 13 |
-
token=api_token
|
| 14 |
)
|
| 15 |
self.model = AutoModelForCausalLM.from_pretrained(
|
| 16 |
model_path,
|
| 17 |
-
token=api_token,
|
| 18 |
trust_remote_code=True,
|
| 19 |
torch_dtype=torch.bfloat16,
|
| 20 |
).to(self.device)
|
|
|
|
| 6 |
from transformers.image_transforms import resize, to_channel_dimension_format
|
| 7 |
|
| 8 |
class EndpointHandler:
|
| 9 |
+
def __init__(self, model_path: str):
|
| 10 |
self.device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 11 |
self.processor = AutoProcessor.from_pretrained(
|
| 12 |
model_path,
|
| 13 |
+
# token=api_token
|
| 14 |
)
|
| 15 |
self.model = AutoModelForCausalLM.from_pretrained(
|
| 16 |
model_path,
|
| 17 |
+
# token=api_token,
|
| 18 |
trust_remote_code=True,
|
| 19 |
torch_dtype=torch.bfloat16,
|
| 20 |
).to(self.device)
|