llmcomp 1.2.2__py3-none-any.whl → 1.2.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- llmcomp/runner/runner.py +14 -2
- {llmcomp-1.2.2.dist-info → llmcomp-1.2.3.dist-info}/METADATA +1 -1
- {llmcomp-1.2.2.dist-info → llmcomp-1.2.3.dist-info}/RECORD +6 -6
- {llmcomp-1.2.2.dist-info → llmcomp-1.2.3.dist-info}/WHEEL +0 -0
- {llmcomp-1.2.2.dist-info → llmcomp-1.2.3.dist-info}/entry_points.txt +0 -0
- {llmcomp-1.2.2.dist-info → llmcomp-1.2.3.dist-info}/licenses/LICENSE +0 -0
llmcomp/runner/runner.py
CHANGED
|
@@ -61,9 +61,21 @@ class Runner:
|
|
|
61
61
|
prepared = self._prepare_for_model(params)
|
|
62
62
|
completion = openai_chat_completion(client=self.client, **prepared)
|
|
63
63
|
try:
|
|
64
|
-
|
|
64
|
+
content = completion.choices[0].message.content
|
|
65
|
+
if content is None:
|
|
66
|
+
# So far all cases here were OpenAI refusals, e.g.
|
|
67
|
+
# ChatCompletion(
|
|
68
|
+
# id='chatcmpl-...',
|
|
69
|
+
# choices=[Choice(
|
|
70
|
+
# finish_reason='stop', index=0, logprobs=None, message=ChatCompletionMessage(
|
|
71
|
+
# content=None,
|
|
72
|
+
# refusal="I'm sorry, I'm unable to fulfill that request.",
|
|
73
|
+
# ...))])
|
|
74
|
+
warnings.warn(f"API sent None as content. Returning empty string.\n{completion}", stacklevel=2)
|
|
75
|
+
return ""
|
|
76
|
+
return content
|
|
65
77
|
except Exception:
|
|
66
|
-
|
|
78
|
+
warnings.warn(f"Unexpected error.\n{completion}")
|
|
67
79
|
raise
|
|
68
80
|
|
|
69
81
|
def single_token_probs(
|
|
@@ -11,9 +11,9 @@ llmcomp/question/question.py,sha256=2CvE0xePLnD5SUJsE_ZyvAIE_36rjjW37fUqG3NHTV0,
|
|
|
11
11
|
llmcomp/question/result.py,sha256=EcgXV-CbLNAQ1Bu0p-0QcjtrwBDt1WxSINwYuMmWoGs,8216
|
|
12
12
|
llmcomp/runner/chat_completion.py,sha256=iDiWE0N0_MYfggD-ouyfUPyaADt7602K5Wo16a7JJo4,967
|
|
13
13
|
llmcomp/runner/model_adapter.py,sha256=xBf6_WZbwKKTctecATujX9ZKQLDetDh-7UeCGaXJ9Zc,3244
|
|
14
|
-
llmcomp/runner/runner.py,sha256=
|
|
15
|
-
llmcomp-1.2.
|
|
16
|
-
llmcomp-1.2.
|
|
17
|
-
llmcomp-1.2.
|
|
18
|
-
llmcomp-1.2.
|
|
19
|
-
llmcomp-1.2.
|
|
14
|
+
llmcomp/runner/runner.py,sha256=C_SQ8pVGaGO57_4B85PMYWyntznsJnIwUOwnH3zP7IA,11494
|
|
15
|
+
llmcomp-1.2.3.dist-info/METADATA,sha256=NJ4ZqfAZo0SC5n1gfSKmPxAFjujTzRWlvkaeBrfUdg8,12518
|
|
16
|
+
llmcomp-1.2.3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
17
|
+
llmcomp-1.2.3.dist-info/entry_points.txt,sha256=1aoN8_W9LDUnX7OIOX7ACmzNkbBMJ6GqNn_A1KUKjQc,76
|
|
18
|
+
llmcomp-1.2.3.dist-info/licenses/LICENSE,sha256=z7WR2X27WF_wZNuzfNFNlkt9cU7eFwP_3-qx7RyrGK4,1064
|
|
19
|
+
llmcomp-1.2.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|