Spaces:
Running
Running
buletomato25
commited on
Commit
·
b241942
1
Parent(s):
cbc2826
deleteauth
Browse files
app.py
CHANGED
@@ -17,8 +17,7 @@ from google.auth.transport import requests as google_requests
|
|
17 |
|
18 |
|
19 |
# Hugging Face のトークン取得(環境変数 HF に設定)
|
20 |
-
|
21 |
-
hf_token = "HUGGINGFACE_HUB_TOKEN"
|
22 |
if hf_token is None:
|
23 |
raise ValueError("HUGGINGFACE_HUB_TOKEN が設定されていません。")
|
24 |
|
@@ -103,13 +102,6 @@ def generate_filename(random_length):
|
|
103 |
filename = f"{current_time}_{random_string}.wav"
|
104 |
return filename
|
105 |
|
106 |
-
|
107 |
-
|
108 |
-
load_dotenv() # .env ファイルを読み込む
|
109 |
-
HUGGINGFACE_HUB_TOKEN = os.getenv("HUGGINGFACE_HUB_TOKEN")
|
110 |
-
if not HUGGINGFACE_HUB_TOKEN:
|
111 |
-
raise ValueError("HUGGINGFACE_HUB_TOKEN が設定されていません。")
|
112 |
-
|
113 |
# トップページ(テンプレート: index.html)
|
114 |
@app.route('/')
|
115 |
def top():
|
|
|
17 |
|
18 |
|
19 |
# Hugging Face のトークン取得(環境変数 HF に設定)
|
20 |
+
hf_token = os.environ.get("HF")
|
|
|
21 |
if hf_token is None:
|
22 |
raise ValueError("HUGGINGFACE_HUB_TOKEN が設定されていません。")
|
23 |
|
|
|
102 |
filename = f"{current_time}_{random_string}.wav"
|
103 |
return filename
|
104 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
# トップページ(テンプレート: index.html)
|
106 |
@app.route('/')
|
107 |
def top():
|