mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-05-19 08:00:25 +00:00
possible fix for broken pipe due to timeouts - send some data first
This commit is contained in:
parent
b6bb9c914e
commit
a82a429fba
1 changed files with 2 additions and 9 deletions
11
koboldcpp.py
11
koboldcpp.py
|
|
@ -3476,15 +3476,14 @@ class KcppServerRequestHandler(http.server.SimpleHTTPRequestHandler):
|
|||
|
||||
async def handle_sse_stream(self, genparams, api_format):
|
||||
global friendlymodelname, currfinishreason
|
||||
# if tools, do not send anything - OAI tool calls will be handled with fakestreaming!
|
||||
using_openai_tools = genparams.get('using_openai_tools', False)
|
||||
if api_format == 4 and using_openai_tools:
|
||||
return
|
||||
self.send_response(200)
|
||||
self.send_header("X-Accel-Buffering", "no")
|
||||
self.send_header("cache-control", "no-cache")
|
||||
self.send_header("connection", "keep-alive")
|
||||
self.end_headers(content_type='text/event-stream')
|
||||
if api_format == 4 and using_openai_tools: # if tools, do not send anything else - OAI tool calls will be handled with fakestreaming!
|
||||
return
|
||||
|
||||
encap_in_thinking = False
|
||||
encap_first_loop = True
|
||||
|
|
@ -4850,12 +4849,6 @@ Change Mode<br>
|
|||
self.end_headers(content_type='application/json')
|
||||
self.wfile.write(genresp)
|
||||
elif api_format == 4 and genparams.get('using_openai_tools', False): #special case, fake streaming for openai tool calls
|
||||
self.send_response(200)
|
||||
self.send_header("X-Accel-Buffering", "no")
|
||||
self.send_header("cache-control", "no-cache")
|
||||
self.send_header("connection", "keep-alive")
|
||||
self.end_headers(content_type='text/event-stream')
|
||||
|
||||
content_text = None
|
||||
toolsdata_res = []
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue