radames commited on
Commit
1b9fb75
β€’
1 Parent(s): 5708566

Add api_key for loading private model

Browse files

In case a user wants the simple Space but accessing a private Model

Files changed (1) hide show
  1. template/app_simple.py +4 -0
template/app_simple.py CHANGED
@@ -1,5 +1,8 @@
 
1
  import gradio as gr
2
 
 
 
3
  article = """---
4
  This space was created using [SD Space Creator](https://huggingface.co/spaces/anzorq/sd-space-creator)."""
5
 
@@ -8,4 +11,5 @@ gr.Interface.load(
8
  title="""$title""",
9
  description="""$description""",
10
  article=article,
 
11
  ).queue(concurrency_count=20).launch()
 
1
+ import os
2
  import gradio as gr
3
 
4
+ API_KEY=os.environ.get('HUGGING_FACE_HUB_TOKEN', None)
5
+
6
  article = """---
7
  This space was created using [SD Space Creator](https://huggingface.co/spaces/anzorq/sd-space-creator)."""
8
 
 
11
  title="""$title""",
12
  description="""$description""",
13
  article=article,
14
+ api_key=API_KEY,
15
  ).queue(concurrency_count=20).launch()