Update app.py
Browse files
app.py
CHANGED
@@ -4,8 +4,8 @@ import sklearn # Ensure scikit-learn is available
|
|
4 |
|
5 |
# Load the trained model and vectorizer safely
|
6 |
try:
|
7 |
-
model = pickle.load(open('model.pkl', 'rb')) # Ensure
|
8 |
-
vectorizer = pickle.load(open('vectorizer.pkl', 'rb'))
|
9 |
except Exception as e:
|
10 |
print(f"Error loading model: {e}")
|
11 |
|
@@ -26,5 +26,5 @@ iface = gr.Interface(
|
|
26 |
description="Enter a message to check if it's spam or not."
|
27 |
)
|
28 |
|
29 |
-
#
|
30 |
-
iface.launch(server_name="0.0.0.0")
|
|
|
4 |
|
5 |
# Load the trained model and vectorizer safely
|
6 |
try:
|
7 |
+
model = pickle.load(open('model.pkl', 'rb')) # Ensure correct file name
|
8 |
+
vectorizer = pickle.load(open('vectorizer.pkl', 'rb'))
|
9 |
except Exception as e:
|
10 |
print(f"Error loading model: {e}")
|
11 |
|
|
|
26 |
description="Enter a message to check if it's spam or not."
|
27 |
)
|
28 |
|
29 |
+
# Ensure Hugging Face properly serves the app
|
30 |
+
iface.launch(server_name="0.0.0.0", server_port=7860, inbrowser=True)
|