fix: 🔊 better logging for ggml completion endpoint
This commit is contained in:
parent
3af4d6b1ed
commit
0459b0c919
1 changed files with 8 additions and 3 deletions
|
|
@ -126,6 +126,11 @@ class GGML(LLM):
|
|||
},
|
||||
) as resp:
|
||||
text = await resp.text()
|
||||
completion = json.loads(text)["choices"][0]["text"]
|
||||
self.write_log(f"Completion: \n\n{completion}")
|
||||
return completion
|
||||
try:
|
||||
completion = json.loads(text)["choices"][0]["text"]
|
||||
self.write_log(f"Completion: \n\n{completion}")
|
||||
return completion
|
||||
except Exception as e:
|
||||
raise Exception(
|
||||
f"Error calling /completion endpoint: {e}\n\nResponse text: {text}"
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue