Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -8,9 +8,12 @@ from PIL import Image
|
|
8 |
import uuid # For generating unique filenames
|
9 |
from transformers import TFAutoModelForSequenceClassification
|
10 |
from transformers import pipeline
|
|
|
|
|
|
|
|
|
11 |
sentiment = pipeline("sentiment-analysis")
|
12 |
# Load your pre-trained model
|
13 |
-
model = load_model(r"C:\Users\nanom\OneDrive\Desktop\midterm implementation\B7_MODEL_Final.h5")
|
14 |
|
15 |
# Function to preprocess the image for prediction
|
16 |
def preprocess_image(img_array, s=224):
|
|
|
8 |
import uuid # For generating unique filenames
|
9 |
from transformers import TFAutoModelForSequenceClassification
|
10 |
from transformers import pipeline
|
11 |
+
from huggingface_hub import hf_hub_download
|
12 |
+
|
13 |
+
model_path = hf_hub_download(repo_id="methestrikerx100/Mineral_Identification_AI", filename="B7_MODEL_Final.h5")
|
14 |
+
model = load_model(model_path)
|
15 |
sentiment = pipeline("sentiment-analysis")
|
16 |
# Load your pre-trained model
|
|
|
17 |
|
18 |
# Function to preprocess the image for prediction
|
19 |
def preprocess_image(img_array, s=224):
|