PeterPinetree commited on
Commit
9f69398
·
verified ·
1 Parent(s): 43c5c70

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -1,9 +1,11 @@
1
  import gradio as gr
 
2
  from huggingface_hub import InferenceClient
3
  import random
4
 
5
- # Initialize the inference client
6
- client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
 
7
 
8
  # Story genres with genre-specific example prompts
9
  GENRE_EXAMPLES = {
 
1
  import gradio as gr
2
+ import os
3
  from huggingface_hub import InferenceClient
4
  import random
5
 
6
+ # Get token from environment variable
7
+ hf_token = os.environ.get("HF_TOKEN")
8
+ client = InferenceClient("HuggingFaceH4/zephyr-7b-beta", token=hf_token)
9
 
10
  # Story genres with genre-specific example prompts
11
  GENRE_EXAMPLES = {