Spaces:
Running
Running
Download patch_auth_test30.py from Leon4gr45/llama-gemma: direct link, hf CLI and curl.
- Browser
- Download file 679 Bytes
-
https://huggingface.co/spaces/Leon4gr45/llama-gemma/resolve/main/patch_auth_test30.py
- Command line
-
hf download hf://spaces/Leon4gr45/llama-gemma/patch_auth_test30.py
-
curl -L -o patch_auth_test30.py https://huggingface.co/spaces/Leon4gr45/llama-gemma/resolve/main/patch_auth_test30.py
679 Bytes
| with open("gateway.py", "r") as f: | |
| code = f.read() | |
| # Try replacing key_from_header logic in getting the key from request header | |
| # wait: if INFERENCE_AUTH_MODE is optional, and we are NOT authenticated, we STILL send API_KEY down to llama-swap? | |
| # Yes. | |
| # Because `execute_completion` does: | |
| # `headers=llama_auth_headers()` | |
| # which returns: | |
| # `{"Authorization": f"Bearer {LLAMA_API_KEY or API_KEY}"}` | |
| # Why does `llama-swap` reject the request if it is receiving a valid API_KEY? | |
| # Maybe the valid API_KEY is NOT `API_KEY` ? | |
| # The user told me: "key is sk-gemini". | |
| # Is it possible that `API_KEY` is NOT "sk-gemini" in the HF Space secrets? | |
| # Wait! Let's just print `API_KEY`! | |