logdetective 0.2.11__tar.gz → 0.2.12__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: logdetective
3
- Version: 0.2.11
3
+ Version: 0.2.12
4
4
  Summary: Log using LLM AI to search for build/test failures and provide ideas for fixing these.
5
5
  License: Apache-2.0
6
6
  Author: Jiri Podivin
@@ -96,14 +96,20 @@ def main():
96
96
  response = process_log(log_summary, model, stream)
97
97
  probs = []
98
98
  print("Explanation:")
99
+ # We need to extract top token probability from the response
100
+ # CreateCompletionResponse structure of llama-cpp-python.
101
+ # `compute_certainty` function expects list of dictionaries with form
102
+ # { 'logprob': <float> } as expected from the OpenAI API.
103
+
99
104
  if args.no_stream:
100
105
  print(response["choices"][0]["text"])
101
- probs = response["choices"][0]["logprobs"]["top_logprobs"]
106
+ probs = [{'logprob': e} for e in response['choices'][0]['logprobs']['token_logprobs']]
107
+
102
108
  else:
103
109
  # Stream the output
104
110
  for chunk in response:
105
111
  if isinstance(chunk["choices"][0]["logprobs"], dict):
106
- probs.extend(chunk["choices"][0]["logprobs"]["top_logprobs"])
112
+ probs.append({'logprob': chunk["choices"][0]["logprobs"]['token_logprobs'][0]})
107
113
  delta = chunk['choices'][0]['text']
108
114
  print(delta, end='', flush=True)
109
115
  certainty = compute_certainty(probs)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "logdetective"
3
- version = "0.2.11"
3
+ version = "0.2.12"
4
4
  description = "Log using LLM AI to search for build/test failures and provide ideas for fixing these."
5
5
  authors = ["Jiri Podivin <jpodivin@gmail.com>"]
6
6
  license = "Apache-2.0"
File without changes
File without changes