Spaces:
Running
Running
Download patch_auth_test35.py from Leon4gr45/llama-gemma: direct link, hf CLI and curl.
- Browser
- Download file 676 Bytes
-
https://huggingface.co/spaces/Leon4gr45/llama-gemma/resolve/main/patch_auth_test35.py
- Command line
-
hf download hf://spaces/Leon4gr45/llama-gemma/patch_auth_test35.py
-
curl -L -o patch_auth_test35.py https://huggingface.co/spaces/Leon4gr45/llama-gemma/resolve/main/patch_auth_test35.py
676 Bytes
| with open("gateway.py", "r") as f: | |
| code = f.read() | |
| # So `llama-swap` is run WITHOUT `env -u`. It inherits `API_KEY`! | |
| # `llama-swap` therefore expects an API Key for authentication if the environment variable `API_KEY` is present. | |
| # My latest commit sets `llama_auth_headers()` to: | |
| # ```python | |
| # def llama_auth_headers() -> dict[str, str]: | |
| # internal_key = LLAMA_API_KEY or API_KEY | |
| # if internal_key: | |
| # return {"Authorization": f"Bearer {internal_key}"} | |
| # return {} | |
| # ``` | |
| # It IS sending `Authorization: Bearer <API_KEY>`! | |
| # Why does `llama-swap` reject it? | |
| # Let's write a python script to hit `llama-swap` directly in the container to figure it out! | |