Update src/app.py
Browse files- src/app.py +5 -0
src/app.py
CHANGED
@@ -1,3 +1,7 @@
|
|
|
|
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
import pandas as pd
|
3 |
import tensorflow as tf
|
@@ -15,6 +19,7 @@ st.write("Upload an image of a lung X-ray to detect lung cancer.")
|
|
15 |
model_path = hf_hub_download(
|
16 |
repo_id="lp128396/lung_cancer_model", # π replace with your actual username and repo
|
17 |
filename="lung_cancer_model.keras"
|
|
|
18 |
)
|
19 |
|
20 |
model = tf.keras.models.load_model(model_path)
|
|
|
1 |
+
import os
|
2 |
+
|
3 |
+
# Forcefully override Hugging Face cache directory
|
4 |
+
os.environ["HF_HOME"] = "/tmp/huggingface"
|
5 |
import streamlit as st
|
6 |
import pandas as pd
|
7 |
import tensorflow as tf
|
|
|
19 |
model_path = hf_hub_download(
|
20 |
repo_id="lp128396/lung_cancer_model", # π replace with your actual username and repo
|
21 |
filename="lung_cancer_model.keras"
|
22 |
+
cache_dir=os.getenv("HF_HOME")
|
23 |
)
|
24 |
|
25 |
model = tf.keras.models.load_model(model_path)
|