()
| 71 | |
| 72 | |
| 73 | async def get_llama_proxy(): |
| 74 | # NOTE: This double lock allows the currently streaming llama model to |
| 75 | # check if any other requests are pending in the same thread and cancel |
| 76 | # the stream if so. |
| 77 | await llama_outer_lock.acquire() |
| 78 | release_outer_lock = True |
| 79 | try: |
| 80 | await llama_inner_lock.acquire() |
| 81 | try: |
| 82 | llama_outer_lock.release() |
| 83 | release_outer_lock = False |
| 84 | yield _llama_proxy |
| 85 | finally: |
| 86 | llama_inner_lock.release() |
| 87 | finally: |
| 88 | if release_outer_lock: |
| 89 | llama_outer_lock.release() |
| 90 | |
| 91 | |
| 92 | _ping_message_factory: typing.Optional[typing.Callable[[], bytes]] = None |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…