Commit ·
d40224e
1
Parent(s): 7ff6a8e
still initial commit
Browse files
app.py
CHANGED
|
@@ -1,9 +1,21 @@
|
|
| 1 |
import os
|
| 2 |
import cv2
|
| 3 |
import numpy as np
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
import gradio as gr
|
| 5 |
import modal
|
| 6 |
-
from datetime import datetime
|
| 7 |
|
| 8 |
# ── Logging Setup ───────────────────────────────────────────────────────────
|
| 9 |
init_logs = []
|
|
|
|
| 1 |
import os
|
| 2 |
import cv2
|
| 3 |
import numpy as np
|
| 4 |
+
from datetime import datetime
|
| 5 |
+
|
| 6 |
+
# ── 🛠️ 0. HUGGINGFACE HUB COMPATIBILITY PATCH ──────────────────────────────
|
| 7 |
+
# Fixes: ImportError: cannot import name 'HfFolder' from 'huggingface_hub'
|
| 8 |
+
# Hugging Face Hub >= 0.27 removed HfFolder, but Gradio 4.44.0 still expects it.
|
| 9 |
+
import huggingface_hub
|
| 10 |
+
if not hasattr(huggingface_hub, "HfFolder"):
|
| 11 |
+
class MockHfFolder:
|
| 12 |
+
@staticmethod
|
| 13 |
+
def get_token():
|
| 14 |
+
return os.environ.get("HF_TOKEN")
|
| 15 |
+
huggingface_hub.HfFolder = MockHfFolder
|
| 16 |
+
|
| 17 |
import gradio as gr
|
| 18 |
import modal
|
|
|
|
| 19 |
|
| 20 |
# ── Logging Setup ───────────────────────────────────────────────────────────
|
| 21 |
init_logs = []
|