zbing commited on
Commit
ebc2977
·
verified ·
1 Parent(s): 2e61315

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. api.py +2 -2
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).to(device)
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