Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,8 @@ import gradio as gr
|
|
| 6 |
def test_api_connection(query: str, api_key: str) -> str:
|
| 7 |
"""Tests the Hugging Face Inference API connection with the provided API key."""
|
| 8 |
try:
|
| 9 |
-
|
|
|
|
| 10 |
response = client.text_classification(query)
|
| 11 |
return f"API connection successful! Response: {response}"
|
| 12 |
except Exception as e:
|
|
|
|
| 6 |
def test_api_connection(query: str, api_key: str) -> str:
|
| 7 |
"""Tests the Hugging Face Inference API connection with the provided API key."""
|
| 8 |
try:
|
| 9 |
+
# Using a different model for testing
|
| 10 |
+
client = InferenceClient(model="distilbert-base-uncased", token=api_key)
|
| 11 |
response = client.text_classification(query)
|
| 12 |
return f"API connection successful! Response: {response}"
|
| 13 |
except Exception as e:
|