Skip to content

Commit

Permalink
Merge pull request #1021 from vespa-engine/andreer/make-gpu-example-work
Browse files Browse the repository at this point in the history
make gpu example work
  • Loading branch information
thomasht86 authored Feb 27, 2025
2 parents 14c7752 + c3f8508 commit 0ca6e51
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions vespa/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def as_lines(self) -> List[str]:
if isinstance(field[1], str):
tmp_string += f"{field[1]}"
else:
tmp_string += f'{", ".join(field[1])}'
tmp_string += f"{', '.join(field[1])}"
final_list.append(tmp_string)

final_list.append("}")
Expand Down Expand Up @@ -936,10 +936,10 @@ def __repr__(self) -> str:

class SecondPhaseRanking(object):
def __init__(
self,
expression: str,
rerank_count: int = 100,
rank_score_drop_limit: Optional[float] = None,
self,
expression: str,
rerank_count: int = 100,
rank_score_drop_limit: Optional[float] = None,
) -> None:
r"""
Create a Vespa second phase ranking configuration.
Expand Down Expand Up @@ -985,10 +985,11 @@ def __repr__(self) -> str:

class GlobalPhaseRanking(object):
def __init__(
self,
expression: str,
rerank_count: int = 100,
rank_score_drop_limit: Optional[float] = None) -> None:
self,
expression: str,
rerank_count: int = 100,
rank_score_drop_limit: Optional[float] = None,
) -> None:
r"""
Create a Vespa global phase ranking configuration.
Expand All @@ -1011,7 +1012,6 @@ def __init__(
self.rerank_count = rerank_count
self.rank_score_drop_limit = rank_score_drop_limit


def __eq__(self, other: object) -> bool:
if not isinstance(other, self.__class__):
return NotImplemented
Expand Down Expand Up @@ -2043,8 +2043,9 @@ def __init__(
... nodes=Nodes(
... count="2",
... parameters=[
... Parameter("resources", {"vcpu": "4.0", "memory": "16Gb", "disk": "125Gb"}),
... Parameter("gpu", {"count": "1", "memory": "16Gb"}),
... Parameter("resources", {"vcpu": "4.0", "memory": "16Gb", "disk": "125Gb"},
... children=[Parameter("gpu", {"count": "1", "memory": "16Gb"})]
... ),
... Parameter("node", {"hostalias": "node1", "distribution-key": "0"}),
... ]
... )
Expand Down

0 comments on commit 0ca6e51

Please sign in to comment.