Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -15,9 +15,22 @@ import json
|
|
15 |
from huggingface_hub import login
|
16 |
from dotenv import load_dotenv
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
# Load environment variables
|
19 |
load_dotenv()
|
20 |
|
|
|
|
|
|
|
|
|
21 |
# Configure logging
|
22 |
logging.basicConfig(
|
23 |
level=logging.INFO,
|
@@ -36,7 +49,6 @@ hf_token = os.getenv("HF_TOKEN")
|
|
36 |
if hf_token:
|
37 |
login(token=hf_token)
|
38 |
|
39 |
-
os.environ.pop("HF_HUB_OFFLINE", None)
|
40 |
|
41 |
|
42 |
class AdaptiveMedicalBot:
|
|
|
15 |
from huggingface_hub import login
|
16 |
from dotenv import load_dotenv
|
17 |
|
18 |
+
# Quick connectivity test to Hugging Face
|
19 |
+
try:
|
20 |
+
import huggingface_hub
|
21 |
+
whoami = huggingface_hub.whoami()
|
22 |
+
print("Hugging Face Login successful:", whoami)
|
23 |
+
except Exception as e:
|
24 |
+
print("Hugging Face Login failed:", e)
|
25 |
+
|
26 |
+
|
27 |
# Load environment variables
|
28 |
load_dotenv()
|
29 |
|
30 |
+
# Suppress TensorFlow INFO and WARNING logs
|
31 |
+
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2"
|
32 |
+
os.environ.pop("HF_HUB_OFFLINE", None)
|
33 |
+
|
34 |
# Configure logging
|
35 |
logging.basicConfig(
|
36 |
level=logging.INFO,
|
|
|
49 |
if hf_token:
|
50 |
login(token=hf_token)
|
51 |
|
|
|
52 |
|
53 |
|
54 |
class AdaptiveMedicalBot:
|