haepada commited on
Commit
3fd9a97
·
verified ·
1 Parent(s): bf9c7d7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -8
app.py CHANGED
@@ -1799,8 +1799,6 @@ def create_interface():
1799
  # Flask 앱 초기화
1800
  load_dotenv()
1801
  app = Flask(__name__)
1802
- gradio_app = create_interface().queue()
1803
- app = gr.mount_gradio_app(app, gradio_app, path="/gradio")
1804
 
1805
  # Flask 라우트
1806
  @app.route('/static/<path:path>')
@@ -1820,14 +1818,28 @@ def index():
1820
  def serve_wishes(path):
1821
  return send_from_directory('data/wishes', path)
1822
 
 
 
 
 
1823
 
1824
  if __name__ == "__main__":
1825
- # PWA 파일들 생성
1826
- create_pwa_files()
1827
 
1828
  # 필요한 디렉토리들 생성
1829
- os.makedirs('static', exist_ok=True)
1830
- os.makedirs('assets', exist_ok=True)
 
 
 
 
 
 
 
 
 
 
1831
 
1832
  # 오디오 파일 체크
1833
  audio_path = os.path.join('assets', 'main_music.mp3')
@@ -1838,7 +1850,7 @@ if __name__ == "__main__":
1838
  else:
1839
  print(f"❌ Audio file not found: {audio_path}")
1840
 
1841
- # Gradio 실행
1842
  demo = create_interface()
1843
  demo.queue().launch(
1844
  server_name="0.0.0.0",
@@ -1850,7 +1862,7 @@ if __name__ == "__main__":
1850
  width="100%",
1851
  favicon_path="static/icons/icon-72x72.png",
1852
 
1853
- # PWA 관련 헤더와 메타 데이터 추가
1854
  head="""
1855
  <link rel="manifest" href="/static/manifest.json">
1856
  <meta name="theme-color" content="#0b0f19">
 
1799
  # Flask 앱 초기화
1800
  load_dotenv()
1801
  app = Flask(__name__)
 
 
1802
 
1803
  # Flask 라우트
1804
  @app.route('/static/<path:path>')
 
1818
  def serve_wishes(path):
1819
  return send_from_directory('data/wishes', path)
1820
 
1821
+ os.makedirs("generated_images", exist_ok=True)
1822
+ os.makedirs('static', exist_ok=True)
1823
+ os.makedirs('assets', exist_ok=True)
1824
+
1825
 
1826
  if __name__ == "__main__":
1827
+ # 환경변수 로드
1828
+ load_dotenv()
1829
 
1830
  # 필요한 디렉토리들 생성
1831
+ required_dirs = [
1832
+ 'static',
1833
+ 'assets',
1834
+ 'data',
1835
+ 'generated_images',
1836
+ 'templates'
1837
+ ]
1838
+ for directory in required_dirs:
1839
+ os.makedirs(directory, exist_ok=True)
1840
+
1841
+ # PWA 파일 생성
1842
+ create_pwa_files()
1843
 
1844
  # 오디오 파일 체크
1845
  audio_path = os.path.join('assets', 'main_music.mp3')
 
1850
  else:
1851
  print(f"❌ Audio file not found: {audio_path}")
1852
 
1853
+ # Gradio 앱만 실행
1854
  demo = create_interface()
1855
  demo.queue().launch(
1856
  server_name="0.0.0.0",
 
1862
  width="100%",
1863
  favicon_path="static/icons/icon-72x72.png",
1864
 
1865
+ # PWA 관련 헤더와 메타 데이터
1866
  head="""
1867
  <link rel="manifest" href="/static/manifest.json">
1868
  <meta name="theme-color" content="#0b0f19">