Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -22,14 +22,6 @@ logger.info(f"MODEL_ID: {MODEL_ID}")
|
|
| 22 |
client = InferenceClient(token=HF_TOKEN) if HF_TOKEN else InferenceClient()
|
| 23 |
logger.info("InferenceClient initialized")
|
| 24 |
|
| 25 |
-
# Force dark mode
|
| 26 |
-
FORCE_DARK_MODE = """
|
| 27 |
-
function() {
|
| 28 |
-
if (document.querySelectorAll('.dark').length === 0) {
|
| 29 |
-
document.querySelector('body').classList.add('dark');
|
| 30 |
-
}
|
| 31 |
-
}
|
| 32 |
-
"""
|
| 33 |
|
| 34 |
|
| 35 |
def classify(image, labels_text: str) -> dict:
|
|
@@ -58,7 +50,7 @@ def classify(image, labels_text: str) -> dict:
|
|
| 58 |
|
| 59 |
logger.info("Building Gradio interface...")
|
| 60 |
|
| 61 |
-
with gr.Blocks(title="Image Detective"
|
| 62 |
gr.Markdown("# 🔍 Image Detective\nUpload an image and define your own categories!")
|
| 63 |
|
| 64 |
with gr.Row(equal_height=True):
|
|
|
|
| 22 |
client = InferenceClient(token=HF_TOKEN) if HF_TOKEN else InferenceClient()
|
| 23 |
logger.info("InferenceClient initialized")
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
|
| 27 |
def classify(image, labels_text: str) -> dict:
|
|
|
|
| 50 |
|
| 51 |
logger.info("Building Gradio interface...")
|
| 52 |
|
| 53 |
+
with gr.Blocks(title="Image Detective") as demo:
|
| 54 |
gr.Markdown("# 🔍 Image Detective\nUpload an image and define your own categories!")
|
| 55 |
|
| 56 |
with gr.Row(equal_height=True):
|