Jiangxz commited on
Commit
ab8c665
·
verified ·
1 Parent(s): b0ec3d3

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -43,6 +43,10 @@ def validate_and_convert(file, Language, api_key):
43
  return None, None, "請輸入正確的 API Key!!", None, None
44
  if api_key == os.getenv("SPACE_ID"):
45
  api_key = os.getenv("YOUR_API_KEY")
 
 
 
 
46
  except Exception as e:
47
  os.remove(file.name)
48
  gr.Warning("請輸入正確的 API Key!!")
@@ -265,7 +269,7 @@ custom_css = """
265
  with gr.Blocks(theme=gr.themes.Monochrome(), css=custom_css) as demo:
266
  gr.Markdown("""
267
  # 📝 凊彩歐北寫 - 財政部財政資訊中心 🎵
268
- > ### **※ 玩轉聲音魅力,開拓更多可能性,自動生成 Note-taking Record,系統布署:江信宗,LLM:<a href="https://huggingface.co/openai/whisper-large-v3" style="color: black;">Whisper large-v3</a>。**<br>依據 <a href="https://www.youtube.com/static?template=terms&hl=zh-Hant" style="color: black;">YouTube 的服務條款(ToS)</a>,請自行明確取得 YouTube 著作權人授權後再上傳影片進行轉譯!
269
  """, elem_classes="center-aligned")
270
  with gr.Row():
271
  file_input = gr.File(
 
43
  return None, None, "請輸入正確的 API Key!!", None, None
44
  if api_key == os.getenv("SPACE_ID"):
45
  api_key = os.getenv("YOUR_API_KEY")
46
+ else:
47
+ os.remove(file.name)
48
+ gr.Warning("請輸入正確的 API Key!!")
49
+ return None, None, "請輸入正確的 API Key!!", None, None
50
  except Exception as e:
51
  os.remove(file.name)
52
  gr.Warning("請輸入正確的 API Key!!")
 
269
  with gr.Blocks(theme=gr.themes.Monochrome(), css=custom_css) as demo:
270
  gr.Markdown("""
271
  # 📝 凊彩歐北寫 - 財政部財政資訊中心 🎵
272
+ > ### **※ 玩轉聲音魅力,開拓更多可能性,自動生成 Note-taking Record,系統布署:江信宗,LLMWhisper large-v3。**<br>依據 <a href="https://www.youtube.com/static?template=terms&hl=zh-Hant" style="color: black;">YouTube 的服務條款(ToS)</a>,請自行明確取得 YouTube 著作權人授權後再上傳影片進行轉譯!
273
  """, elem_classes="center-aligned")
274
  with gr.Row():
275
  file_input = gr.File(