Skip to content

Commit e6bfab7

Browse files
fix(pre_commit): 🎨 auto format pre-commit hooks
1 parent a454a9c commit e6bfab7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

roboflow/util/model_processor.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,8 @@ def _process_rfdetr(model_type: str, model_path: str, filename: str) -> str:
250250
if pt_file is None:
251251
raise RuntimeError("No .pt model file found in the provided path")
252252

253-
254253
class_names = get_classnames_txt_for_rfdetr(model_path, pt_file)
255254

256-
257255
# Copy the .pt file to weights.pt if not already named weights.pt
258256
if pt_file != "weights.pt":
259257
shutil.copy(os.path.join(model_path, pt_file), os.path.join(model_path, "weights.pt"))
@@ -273,11 +271,12 @@ def _process_rfdetr(model_type: str, model_path: str, filename: str) -> str:
273271

274272
return zip_file_name
275273

274+
276275
def get_classnames_txt_for_rfdetr(model_path: str, pt_file: str) -> list[str]:
277276
class_names_path = os.path.join(model_path, "class_names.txt")
278277
if os.path.exists(class_names_path):
279278
return class_names_path
280-
279+
281280
model = torch.load(os.path.join(model_path, pt_file), map_location="cpu", weights_only=False)
282281
args = vars(model["args"])
283282
if "class_names" in args:

0 commit comments

Comments
 (0)