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.
- {logdetective-0.2.11 → logdetective-0.2.12}/PKG-INFO +1 -1
- {logdetective-0.2.11 → logdetective-0.2.12}/logdetective/logdetective.py +8 -2
- {logdetective-0.2.11 → logdetective-0.2.12}/pyproject.toml +1 -1
- {logdetective-0.2.11 → logdetective-0.2.12}/LICENSE +0 -0
- {logdetective-0.2.11 → logdetective-0.2.12}/README.md +0 -0
- {logdetective-0.2.11 → logdetective-0.2.12}/logdetective/__init__.py +0 -0
- {logdetective-0.2.11 → logdetective-0.2.12}/logdetective/constants.py +0 -0
- {logdetective-0.2.11 → logdetective-0.2.12}/logdetective/drain3.ini +0 -0
- {logdetective-0.2.11 → logdetective-0.2.12}/logdetective/extractors.py +0 -0
- {logdetective-0.2.11 → logdetective-0.2.12}/logdetective/server.py +0 -0
- {logdetective-0.2.11 → logdetective-0.2.12}/logdetective/utils.py +0 -0
|
@@ -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[
|
|
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.
|
|
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)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|