mirror of
https://github.com/imartinez/privateGPT.git
synced 2025-07-02 02:03:01 +00:00
fix: Replacing unsafe eval()
with json.loads()
(#1890)
This commit is contained in:
parent
e21bf20c10
commit
9d0d614706
@ -218,7 +218,7 @@ class SagemakerLLM(CustomLLM):
|
||||
|
||||
response_body = resp["Body"]
|
||||
response_str = response_body.read().decode("utf-8")
|
||||
response_dict = eval(response_str)
|
||||
response_dict = json.loads(response_str)
|
||||
|
||||
return CompletionResponse(
|
||||
text=response_dict[0]["generated_text"][len(prompt) :], raw=resp
|
||||
|
Loading…
Reference in New Issue
Block a user