Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -20,9 +20,13 @@ def load_model():
|
|
20 |
print(f"Error loading the model: {e}")
|
21 |
return None
|
22 |
|
23 |
-
# Load the model
|
24 |
learn = load_model()
|
25 |
|
|
|
|
|
|
|
|
|
26 |
# Step 9: Define the Gradio Interface
|
27 |
def predict(input_text):
|
28 |
try:
|
|
|
20 |
print(f"Error loading the model: {e}")
|
21 |
return None
|
22 |
|
23 |
+
# Load the model (this will be run at the start)
|
24 |
learn = load_model()
|
25 |
|
26 |
+
# Check if the model is loaded successfully
|
27 |
+
if learn is None:
|
28 |
+
raise ValueError("Failed to load the model")
|
29 |
+
|
30 |
# Step 9: Define the Gradio Interface
|
31 |
def predict(input_text):
|
32 |
try:
|