Skip to content

Commit

Permalink
Fix Type Error in Cudo
Browse files Browse the repository at this point in the history
  • Loading branch information
Bihan Rana authored and Bihan Rana committed Mar 13, 2024
1 parent 21b7155 commit 361885e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/gpuhunt/providers/cudo.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def fetch_offers(
return list(chain.from_iterable(offers))

@staticmethod
def list_vm_machine_types() -> list[dict]:
def list_vm_machine_types():
resp = requests.request(
method="GET",
url=f"{API_URL}/vms/machine-types-2",
Expand All @@ -60,9 +60,7 @@ def list_vm_machine_types() -> list[dict]:
resp.raise_for_status()

@staticmethod
def optimize_offers(
machine_types: list[dict], q: QueryFilter, balance_resource
) -> List[RawCatalogItem]:
def optimize_offers(machine_types, q: QueryFilter, balance_resource) -> List[RawCatalogItem]:
offers = []
if any(
condition is not None
Expand Down Expand Up @@ -136,7 +134,7 @@ def get_raw_catalog(machine_type, spec):
return raw


def optimize_offers_with_gpu(q: QueryFilter, machine_type, balance_resources) -> List[dict]:
def optimize_offers_with_gpu(q: QueryFilter, machine_type, balance_resources):
# Generate ranges for CPU, GPU, and memory based on the specified minimums, maximums, and available resources
cpu_range = get_cpu_range(q.min_cpu, q.max_cpu, machine_type["maxVcpuFree"])
gpu_range = get_gpu_range(q.min_gpu_count, q.max_gpu_count, machine_type["maxGpuFree"])
Expand Down Expand Up @@ -200,7 +198,7 @@ def optimize_offers_with_gpu(q: QueryFilter, machine_type, balance_resources) ->
return unbalanced_specs


def optimize_offers_no_gpu(q: QueryFilter, machine_type, balance_resource) -> List[dict]:
def optimize_offers_no_gpu(q: QueryFilter, machine_type, balance_resource):
# Generate ranges for CPU, memory based on the specified minimums, maximums, and available resources
cpu_range = get_cpu_range(q.min_cpu, q.max_cpu, machine_type["maxVcpuFree"])
memory_range = get_memory_range(q.min_memory, q.max_memory, machine_type["maxMemoryGibFree"])
Expand Down

0 comments on commit 361885e

Please sign in to comment.