Spaces:
Sleeping
Sleeping
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -39,6 +39,20 @@ if not hasattr(huggingface_hub, "HfFolder"):
|
|
| 39 |
from huggingface_hub import HfApi
|
| 40 |
import gradio as gr
|
| 41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
# Internal System Modules
|
| 43 |
import quant_data
|
| 44 |
import quant_regimes
|
|
|
|
| 39 |
from huggingface_hub import HfApi
|
| 40 |
import gradio as gr
|
| 41 |
|
| 42 |
+
# Websockets 12 / yfinance live compatibility shim
|
| 43 |
+
import sys, types
|
| 44 |
+
try:
|
| 45 |
+
import websockets.asyncio
|
| 46 |
+
except (ImportError, ModuleNotFoundError):
|
| 47 |
+
try:
|
| 48 |
+
ws_asyncio = types.ModuleType("websockets.asyncio")
|
| 49 |
+
ws_asyncio_client = types.ModuleType("websockets.asyncio.client")
|
| 50 |
+
ws_asyncio_client.connect = None
|
| 51 |
+
sys.modules["websockets.asyncio"] = ws_asyncio
|
| 52 |
+
sys.modules["websockets.asyncio.client"] = ws_asyncio_client
|
| 53 |
+
except Exception:
|
| 54 |
+
pass
|
| 55 |
+
|
| 56 |
# Internal System Modules
|
| 57 |
import quant_data
|
| 58 |
import quant_regimes
|