update rest and other parts of the code to work with arch fc 1.1

This commit is contained in:
Adil Hafeez 2025-03-28 03:04:12 -07:00
parent e5949c584f
commit b31a7a569a
No known key found for this signature in database
GPG key ID: 9B18EF7691369645
8 changed files with 196 additions and 47 deletions

View file

@ -120,8 +120,11 @@ def process_stream_chunk(chunk, history):
if delta.content:
# append content to the last history item
history[-1]["content"] = history[-1].get("content", "") + delta.content
if history[-1]["model"] != "Arch-Function-Chat":
history[-1]["content"] = history[-1].get("content", "") + delta.content
# yield content if it is from assistant
if history[-1]["model"] == "Arch-Function":
return None
if history[-1]["role"] == "assistant":
return delta.content