Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cf8ae5a

Browse filesBrowse files
committed
Merge branch 'main' of github.com:abetlen/llama_cpp_python into main
2 parents 5da5773 + 3d5e5b1 commit cf8ae5a
Copy full SHA for cf8ae5a

File tree

Expand file treeCollapse file tree

1 file changed

+6
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-1
lines changed

‎llama_cpp/server/app.py

Copy file name to clipboardExpand all lines: llama_cpp/server/app.py
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import json
22
import multiprocessing
3+
import time
34
from re import compile, Match, Pattern
45
from threading import Lock
56
from functools import partial
@@ -271,7 +272,11 @@ def get_route_handler(
271272

272273
async def custom_route_handler(request: Request) -> Response:
273274
try:
274-
return await original_route_handler(request)
275+
start_sec = time.perf_counter()
276+
response = await original_route_handler(request)
277+
elapsed_time_ms = int((time.perf_counter() - start_sec) * 1000)
278+
response.headers["openai-processing-ms"] = f"{elapsed_time_ms}"
279+
return response
275280
except Exception as exc:
276281
json_body = await request.json()
277282
try:

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.