update proxy cli

This commit is contained in:
Krrish Dholakia 2023-09-28 16:24:41 -07:00
parent c5bed0c9fd
commit 09b8c08cad
7 changed files with 92 additions and 35 deletions

View file

@ -2876,9 +2876,10 @@ class CustomStreamWrapper:
text = ""
is_finished = False
finish_reason = ""
print_verbose(f"chunk: {chunk}")
if chunk.startswith("data:"):
data_json = json.loads(chunk[5:])
print(f"data json: {data_json}")
print_verbose(f"data json: {data_json}")
if "token" in data_json and "text" in data_json["token"]:
text = data_json["token"]["text"]
if "meta-llama/Llama-2" in self.model: #clean eos tokens like </s> from the returned output text