Spaces:
Runtime error
Runtime error
OmarEllethy
commited on
Commit
•
4bbe7c5
1
Parent(s):
d75a914
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import subprocess
|
2 |
-
import
|
3 |
import numpy as np
|
4 |
from PIL import Image
|
5 |
import io
|
@@ -27,8 +27,12 @@ libraries = [
|
|
27 |
for library in libraries:
|
28 |
install_package(library)
|
29 |
|
30 |
-
#
|
31 |
-
|
|
|
|
|
|
|
|
|
32 |
|
33 |
# Load the pre-trained TensorFlow model
|
34 |
model = tf.keras.models.load_model("imageclassifier.h5")
|
|
|
1 |
import subprocess
|
2 |
+
import tensorflow as tf
|
3 |
import numpy as np
|
4 |
from PIL import Image
|
5 |
import io
|
|
|
27 |
for library in libraries:
|
28 |
install_package(library)
|
29 |
|
30 |
+
# Attempt to import required libraries after installation
|
31 |
+
try:
|
32 |
+
import joblib
|
33 |
+
except ImportError:
|
34 |
+
print("Error: joblib failed to install or import.")
|
35 |
+
exit(1)
|
36 |
|
37 |
# Load the pre-trained TensorFlow model
|
38 |
model = tf.keras.models.load_model("imageclassifier.h5")
|