Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Software Engineering For ML CW1
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sm1524
Software Engineering For ML CW1
Commits
ebe8a3a0
Commit
ebe8a3a0
authored
1 month ago
by
Stavros Mitsis
Browse files
Options
Downloads
Patches
Plain Diff
Commit test
parent
43894a65
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
model.py
+1
-1
1 addition, 1 deletion
model.py
with
1 addition
and
1 deletion
model.py
+
1
−
1
View file @
ebe8a3a0
...
...
@@ -48,7 +48,7 @@ def main():
# Load the final trained model (entire model, not just state_dict)
device
=
torch
.
device
(
"
cuda
"
if
torch
.
cuda
.
is_available
()
else
"
cpu
"
)
model_path
=
os
.
path
.
join
(
base_dir
,
"
best_model.pth
"
)
model
=
torch
.
load
(
model_path
)
model
=
torch
.
load
(
model_path
,
map_location
=
device
)
# Also load the threshold from the best hyperparameters
hyperparams_path
=
os
.
path
.
join
(
base_dir
,
"
best_hyperparameters.json
"
)
with
open
(
hyperparams_path
,
"
r
"
)
as
f
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment