oKen38461 commited on
Commit
4b17b0c
·
1 Parent(s): f4998a2

グローバル変数の定義を整理し、遅延インポートの部分を削除しました。また、SDK初期化のための新しいグローバル変数`SDK`を追加しました。

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -13,11 +13,6 @@ except ImportError as e:
13
  print(f"⚠️ filetype import failed: {e}")
14
  print("Using fallback file type detection")
15
 
16
- # 遅延インポート(モデルダウンロード後)
17
- StreamSDK = None
18
- run = None
19
- seed_everything = None
20
-
21
  # モデルの初期化
22
  print("=== モデルの初期化開始 ===")
23
 
@@ -36,9 +31,11 @@ else:
36
  data_root = "./checkpoints/ditto_trt_Ampere_Plus"
37
  cfg_pkl = "./checkpoints/ditto_cfg/v0.4_hubert_cfg_trt.pkl"
38
 
 
 
 
39
  try:
40
  # モジュールをインポート
41
- global StreamSDK, run, seed_everything
42
  from stream_pipeline_offline import StreamSDK
43
  from inference import run, seed_everything
44
 
 
13
  print(f"⚠️ filetype import failed: {e}")
14
  print("Using fallback file type detection")
15
 
 
 
 
 
 
16
  # モデルの初期化
17
  print("=== モデルの初期化開始 ===")
18
 
 
31
  data_root = "./checkpoints/ditto_trt_Ampere_Plus"
32
  cfg_pkl = "./checkpoints/ditto_cfg/v0.4_hubert_cfg_trt.pkl"
33
 
34
+ # SDK初期化のためのグローバル変数
35
+ SDK = None
36
+
37
  try:
38
  # モジュールをインポート
 
39
  from stream_pipeline_offline import StreamSDK
40
  from inference import run, seed_everything
41