Skip to content

Commit

Permalink
fix: remove gpu_model constraint if model is not specified
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnacioHeredia committed Jan 18, 2024
1 parent d31e3f5 commit 3d11fdb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ai4papi/routers/v1/deployments/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,11 @@ def create_deployment(
# Modify the GPU section
if user_conf['hardware']['gpu_num'] <= 0:
# Delete GPU section in CPU deployments
del usertask['Resources']['Devices']
usertask['Resources']['Devices'] = None
else:
# If gpu_type not provided, remove affinity to GPU model
# If gpu_type not provided, remove constraint to GPU model
if not user_conf['hardware']['gpu_type']:
del usertask['Resources']['Devices'][0]['Affinities']
usertask['Resources']['Devices'][0]['Constraints'] = None

# If storage credentials not provided, remove storage-related tasks
if not all(user_conf['storage'].values()):
Expand Down

0 comments on commit 3d11fdb

Please sign in to comment.