Upload app.py
Browse files
app.py
CHANGED
@@ -376,6 +376,7 @@ def initialize_model():
|
|
376 |
|
377 |
@spaces.GPU()
|
378 |
def predict(image_input, gen_threshold, char_threshold, output_mode):
|
|
|
379 |
"""Gradioインターフェース用の予測関数"""
|
380 |
initialize_model() # モデルがロードされていなければロード
|
381 |
|
@@ -594,5 +595,5 @@ if __name__ == "__main__":
|
|
594 |
if not os.environ.get("HF_TOKEN"):
|
595 |
print("Warning: HF_TOKEN environment variable not set. Downloads from private repositories may fail.")
|
596 |
# Initialize model on startup to avoid delay on first prediction
|
597 |
-
|
598 |
demo.launch(share=True)
|
|
|
376 |
|
377 |
@spaces.GPU()
|
378 |
def predict(image_input, gen_threshold, char_threshold, output_mode):
|
379 |
+
print("--- predict function started ---") # Add log here
|
380 |
"""Gradioインターフェース用の予測関数"""
|
381 |
initialize_model() # モデルがロードされていなければロード
|
382 |
|
|
|
595 |
if not os.environ.get("HF_TOKEN"):
|
596 |
print("Warning: HF_TOKEN environment variable not set. Downloads from private repositories may fail.")
|
597 |
# Initialize model on startup to avoid delay on first prediction
|
598 |
+
initialize_model() # Removed startup initialization
|
599 |
demo.launch(share=True)
|