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