mirror of
https://github.com/zylon-ai/private-gpt.git
synced 2025-12-22 20:12:55 +01:00
fix: Replacing unsafe eval() with json.loads() (#1890)
Some checks failed
release-please / release-please (push) Has been cancelled
tests / setup (push) Has been cancelled
tests / ${{ matrix.quality-command }} (black) (push) Has been cancelled
tests / ${{ matrix.quality-command }} (mypy) (push) Has been cancelled
tests / ${{ matrix.quality-command }} (ruff) (push) Has been cancelled
tests / test (push) Has been cancelled
tests / all_checks_passed (push) Has been cancelled
Some checks failed
release-please / release-please (push) Has been cancelled
tests / setup (push) Has been cancelled
tests / ${{ matrix.quality-command }} (black) (push) Has been cancelled
tests / ${{ matrix.quality-command }} (mypy) (push) Has been cancelled
tests / ${{ matrix.quality-command }} (ruff) (push) Has been cancelled
tests / test (push) Has been cancelled
tests / all_checks_passed (push) Has been cancelled
This commit is contained in:
parent
e21bf20c10
commit
9d0d614706
1 changed files with 1 additions and 1 deletions
|
|
@ -218,7 +218,7 @@ class SagemakerLLM(CustomLLM):
|
||||||
|
|
||||||
response_body = resp["Body"]
|
response_body = resp["Body"]
|
||||||
response_str = response_body.read().decode("utf-8")
|
response_str = response_body.read().decode("utf-8")
|
||||||
response_dict = eval(response_str)
|
response_dict = json.loads(response_str)
|
||||||
|
|
||||||
return CompletionResponse(
|
return CompletionResponse(
|
||||||
text=response_dict[0]["generated_text"][len(prompt) :], raw=resp
|
text=response_dict[0]["generated_text"][len(prompt) :], raw=resp
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue