Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -35,6 +35,12 @@ def respond(
|
|
35 |
# Determine which token to use - custom API key if provided, otherwise the ACCESS_TOKEN
|
36 |
token_to_use = custom_api_key if custom_api_key.strip() != "" else ACCESS_TOKEN
|
37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
# Initialize the Inference Client with the provider and appropriate token
|
39 |
client = InferenceClient(token=token_to_use, provider=provider)
|
40 |
print(f"Hugging Face Inference Client initialized with {provider} provider.")
|
|
|
35 |
# Determine which token to use - custom API key if provided, otherwise the ACCESS_TOKEN
|
36 |
token_to_use = custom_api_key if custom_api_key.strip() != "" else ACCESS_TOKEN
|
37 |
|
38 |
+
# Log which token source we're using (without printing the actual token)
|
39 |
+
if custom_api_key.strip() != "":
|
40 |
+
print("USING CUSTOM API KEY: BYOK token provided by user is being used for authentication")
|
41 |
+
else:
|
42 |
+
print("USING DEFAULT API KEY: Environment variable HF_TOKEN is being used for authentication")
|
43 |
+
|
44 |
# Initialize the Inference Client with the provider and appropriate token
|
45 |
client = InferenceClient(token=token_to_use, provider=provider)
|
46 |
print(f"Hugging Face Inference Client initialized with {provider} provider.")
|