Procházet zdrojové kódy

api_like_OAI.py : simplify function (#2796)

Simplify function
arcrank před 2 roky
rodič
revize
9c38d181d4
1 změnil soubory, kde provedl 1 přidání a 7 odebrání
  1. 1 7
      examples/server/api_like_OAI.py

+ 1 - 7
examples/server/api_like_OAI.py

@@ -23,13 +23,7 @@ parser.add_argument("--port", type=int, help="Set the port to listen.(default: 8
 args = parser.parse_args()
 
 def is_present(json, key):
-    try:
-        buf = json[key]
-    except KeyError:
-        return False
-    return True
-
-
+    return key in json
 
 #convert chat to prompt
 def convert_chat(messages):