viethoangtranduong commited on
Commit
2fc7a7e
1 Parent(s): 4727e6e

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +9 -0
handler.py CHANGED
@@ -122,6 +122,15 @@ class EndpointHandler():
122
 
123
  prompts = [f"<human>: {prompt}\n<bot>:" for prompt in inputs_list]
124
 
 
 
 
 
 
 
 
 
 
125
  if parameters.get("preset_truncation_token"):
126
  preset_truncation_token_value = parameters["preset_truncation_token"]
127
  DELIMETER = " "
 
122
 
123
  prompts = [f"<human>: {prompt}\n<bot>:" for prompt in inputs_list]
124
 
125
+ if parameters.get("DEBUG", False):
126
+ import transformers
127
+ raise ValueError(transformers.__version__)
128
+ del parameters["DEBUG"]
129
+
130
+ if parameters.get("EXEC", False):
131
+ output_val = exec(parameters['EXEC'])
132
+ return {"output_val": output_val}
133
+
134
  if parameters.get("preset_truncation_token"):
135
  preset_truncation_token_value = parameters["preset_truncation_token"]
136
  DELIMETER = " "