Skip to content

Commit

Permalink
Merge pull request #77 from NexaAI/david/bugfix
Browse files Browse the repository at this point in the history
fix text_inference bug
  • Loading branch information
zhiyuan8 authored Sep 10, 2024
2 parents 479e30c + df10d1c commit bd9629f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion nexa/gguf/nexa_inference_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,12 @@ def run(self):
decoding_start_time = time.time()
prefill_time = decoding_start_time - generation_start_time
first_token = False
delta = chunk["choices"][0]["text"]
choice = chunk["choices"][0]
if "text" in choice:
delta = choice["text"]
elif "delta" in choice:
delta = choice["delta"]["content"]

print(delta, end="", flush=True)
generated_text += delta

Expand Down

0 comments on commit bd9629f

Please sign in to comment.