Skip to content

Commit 4868862

Browse files
nagkumar91Nagkumar Arkalgud
andauthored
Fix eval() to ast.literal_eval() (Azure#37297)
Co-authored-by: Nagkumar Arkalgud <[email protected]>
1 parent 4722411 commit 4868862

File tree

1 file changed

+2
-1
lines changed
  • sdk/ai/azure-ai-generative/azure/ai/generative/synthetic/simulator/_model_tools

1 file changed

+2
-1
lines changed

sdk/ai/azure-ai-generative/azure/ai/generative/synthetic/simulator/_model_tools/models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Copyright (c) Microsoft Corporation. All rights reserved.
33
# ---------------------------------------------------------
44
# pylint: skip-file
5+
import ast
56
import copy
67
import time
78
import asyncio
@@ -272,7 +273,7 @@ def __init__(
272273
stop = []
273274
# Else if stop sequence is given as a string (Ex: "["\n", "<im_end>"]"), convert
274275
elif type(stop) is str and stop.startswith("[") and stop.endswith("]"):
275-
stop = eval(stop)
276+
stop = ast.literal_eval(stop)
276277
elif type(stop) is str:
277278
stop = [stop]
278279
self.stop: List = stop # type: ignore[assignment]

0 commit comments

Comments
 (0)