Upload folder using huggingface_hub
Browse files
api.py
CHANGED
@@ -17,8 +17,8 @@ args = parser.parse_args()
|
|
17 |
# Determine the device
|
18 |
device = "cpu"
|
19 |
# Initialize the model and processor
|
20 |
-
model = AutoModelForCausalLM.from_pretrained(args.model_path, trust_remote_code=True
|
21 |
-
processor = AutoProcessor.from_pretrained(args.model_path, trust_remote_code=True)
|
22 |
|
23 |
lock = threading.Lock() # Use a lock to ensure thread safety when accessing the model
|
24 |
|
|
|
17 |
# Determine the device
|
18 |
device = "cpu"
|
19 |
# Initialize the model and processor
|
20 |
+
model = AutoModelForCausalLM.from_pretrained(args.model_path, trust_remote_code=True, device_map=device)
|
21 |
+
processor = AutoProcessor.from_pretrained(args.model_path, trust_remote_code=True, device_map=device)
|
22 |
|
23 |
lock = threading.Lock() # Use a lock to ensure thread safety when accessing the model
|
24 |
|