wahab5763 commited on
Commit
8733506
·
verified ·
1 Parent(s): 7318424

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -1,4 +1,3 @@
1
-
2
  import os
3
  import gradio as gr
4
  from huggingface_hub import InferenceClient
@@ -23,7 +22,7 @@ def authenticate_client():
23
  Retrieves the 'TextToImage' token (stored as HF_TOKEN secret)
24
  from the Space environment.
25
  """
26
- hf_token = os.getenv("TextToImage")
27
  if not hf_token:
28
  raise ValueError("HF_TOKEN secret not found. Please add your 'TextToImage' token to Space Secrets.")
29
  return InferenceClient(token=hf_token)
@@ -106,5 +105,4 @@ def build_app():
106
 
107
  if __name__ == "__main__":
108
  app = build_app()
109
- app.launch()
110
- ```
 
 
1
  import os
2
  import gradio as gr
3
  from huggingface_hub import InferenceClient
 
22
  Retrieves the 'TextToImage' token (stored as HF_TOKEN secret)
23
  from the Space environment.
24
  """
25
+ hf_token = os.getenv("HF_TOKEN")
26
  if not hf_token:
27
  raise ValueError("HF_TOKEN secret not found. Please add your 'TextToImage' token to Space Secrets.")
28
  return InferenceClient(token=hf_token)
 
105
 
106
  if __name__ == "__main__":
107
  app = build_app()
108
+ app.launch()