haepada commited on
Commit
d6db697
·
verified ·
1 Parent(s): a4c78d2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -14
app.py CHANGED
@@ -9,9 +9,6 @@ from transformers import pipeline
9
  import requests
10
  from dotenv import load_dotenv
11
 
12
- # 환경변수 로드
13
- load_dotenv()
14
-
15
  # 상수 정의
16
  WELCOME_MESSAGE = """
17
  # 디지털 굿판에 오신 것을 환영합니다
@@ -34,10 +31,10 @@ ONCHEON_STORY = """
34
  """
35
 
36
  # Flask 앱 초기화
37
- app = Flask(__name__)
38
-
39
- # 환경변수 로드
40
  load_dotenv()
 
 
 
41
 
42
  # Flask 라우트
43
  @app.route('/static/<path:path>')
@@ -48,15 +45,10 @@ def serve_static(path):
48
  def index():
49
  return render_template('index.html')
50
 
 
51
  @app.route('/assets/<path:path>')
52
- def serve_assets(path):
53
- try:
54
- if path.endswith('.mp3'):
55
- return send_from_directory('assets', path, mimetype='audio/mpeg')
56
- return send_from_directory('assets', path)
57
- except Exception as e:
58
- print(f"Asset serving error: {e}")
59
- return f"Error serving asset: {path}", 404
60
 
61
  @app.route('/wishes/<path:path>')
62
  def serve_wishes(path):
 
9
  import requests
10
  from dotenv import load_dotenv
11
 
 
 
 
12
  # 상수 정의
13
  WELCOME_MESSAGE = """
14
  # 디지털 굿판에 오신 것을 환영합니다
 
31
  """
32
 
33
  # Flask 앱 초기화
 
 
 
34
  load_dotenv()
35
+ app = Flask(__name__)
36
+ gradio_app = create_interface().queue()
37
+ app = gr.mount_gradio_app(app, gradio_app, path="/gradio")
38
 
39
  # Flask 라우트
40
  @app.route('/static/<path:path>')
 
45
  def index():
46
  return render_template('index.html')
47
 
48
+ @app.route('/static/<path:path>')
49
  @app.route('/assets/<path:path>')
50
+ @app.route('/manifest.json')
51
+ @app.route('/service-worker.js')
 
 
 
 
 
 
52
 
53
  @app.route('/wishes/<path:path>')
54
  def serve_wishes(path):