Skip to content

Commit

Permalink
drafting
Browse files Browse the repository at this point in the history
  • Loading branch information
riship committed Jan 25, 2025
1 parent 11bfb1f commit b05a9c3
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions torch_geometric/nn/nlp/llm_judge.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,20 @@ def score(
score1 = float("nan")
score1 = float("nan")
for retry in range(10):
score1 = self._process_score(
call_NIM(prompt1, self.NVIDIA_API_KEY, self.NIM_MODEL))
if not isnan(score1):
break
try:
score1 = self._process_score(
call_NIM(prompt1, self.NVIDIA_API_KEY, self.NIM_MODEL))
if not isnan(score1):
break
except: # noqa
pass
for retry in range(10):
score2 = self._process_score(
call_NIM(prompt2, self.NVIDIA_API_KEY, self.NIM_MODEL))
if not isnan(score2):
break
try:
score2 = self._process_score(
call_NIM(prompt2, self.NVIDIA_API_KEY, self.NIM_MODEL))
if not isnan(score2):
break
except:
pass

return self._average_scores(score1, score2)

0 comments on commit b05a9c3

Please sign in to comment.