tsengiii commited on
Commit
02a9fc7
·
verified ·
1 Parent(s): 998d23e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -1,10 +1,10 @@
1
  import gradio as gr
2
  import requests
3
- import os # 用於讀取環境變數
4
 
5
  # 從環境變數讀取 Hugging Face API token
6
  API_URL = "https://api-inference.huggingface.co/models/KappaNeuro/ukiyo-e-art"
7
- HF_API_TOKEN = os.getenv("HF_API_TOKEN") # 從環境變數讀取 API token
8
  headers = {"Authorization": f"Bearer {HF_API_TOKEN}"}
9
 
10
  def query(payload):
@@ -35,3 +35,4 @@ interface = gr.Interface(
35
 
36
  # 啟動 Gradio 應用
37
  interface.launch()
 
 
1
  import gradio as gr
2
  import requests
3
+ import os
4
 
5
  # 從環境變數讀取 Hugging Face API token
6
  API_URL = "https://api-inference.huggingface.co/models/KappaNeuro/ukiyo-e-art"
7
+ HF_API_TOKEN = os.getenv("HF_API_TOKEN") # 確認您已將此變數在 Hugging Face Spaces 的 Secret 中設定
8
  headers = {"Authorization": f"Bearer {HF_API_TOKEN}"}
9
 
10
  def query(payload):
 
35
 
36
  # 啟動 Gradio 應用
37
  interface.launch()
38
+