Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,8 +3,9 @@ from transformers import pipeline
|
|
3 |
|
4 |
# Try loading the model with a fallback for any loading errors
|
5 |
try:
|
6 |
-
|
7 |
qa_pipeline = pipeline("question-answering", model="distilbert-base-uncased-distilled-squad")
|
|
|
8 |
except Exception as e:
|
9 |
# Print error message for debugging purposes
|
10 |
print(f"Error loading model: {e}")
|
@@ -26,5 +27,7 @@ interface = gr.Interface(
|
|
26 |
description="Ask a question based on the given context.",
|
27 |
)
|
28 |
|
|
|
|
|
29 |
# Launch the interface
|
30 |
-
interface.launch()
|
|
|
3 |
|
4 |
# Try loading the model with a fallback for any loading errors
|
5 |
try:
|
6 |
+
print("Loading the model...")
|
7 |
qa_pipeline = pipeline("question-answering", model="distilbert-base-uncased-distilled-squad")
|
8 |
+
print("Model loaded successfully.")
|
9 |
except Exception as e:
|
10 |
# Print error message for debugging purposes
|
11 |
print(f"Error loading model: {e}")
|
|
|
27 |
description="Ask a question based on the given context.",
|
28 |
)
|
29 |
|
30 |
+
# Print a message before launching the app to confirm it's starting
|
31 |
+
print("Launching the Gradio interface...")
|
32 |
# Launch the interface
|
33 |
+
interface.launch()
|