mirror of
https://github.com/fauxpilot/fauxpilot.git
synced 2025-07-11 15:46:45 -07:00
Error handling
This commit is contained in:
parent
6671196ec8
commit
6f49915d2a
3 changed files with 9 additions and 4 deletions
|
@ -6,7 +6,7 @@ import time
|
|||
import numpy as np
|
||||
import tritonclient.grpc as client_util
|
||||
from tokenizers import Tokenizer
|
||||
from tritonclient.utils import np_to_triton_dtype
|
||||
from tritonclient.utils import np_to_triton_dtype, InferenceServerException
|
||||
|
||||
np.finfo(np.dtype("float32"))
|
||||
np.finfo(np.dtype("float64"))
|
||||
|
@ -230,7 +230,12 @@ class CodeGenProxy:
|
|||
|
||||
def __call__(self, data: dict):
|
||||
st = time.time()
|
||||
completion, choices = self.generate(data)
|
||||
try:
|
||||
completion, choices = self.generate(data)
|
||||
except InferenceServerException as E:
|
||||
print(E)
|
||||
completion = {}
|
||||
choices = []
|
||||
ed = time.time()
|
||||
print(f"Returned completion in {(ed - st) * 1000} ms")
|
||||
if data.get('stream', False):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue