Akjava commited on
Commit
8fd7075
Β·
verified Β·
1 Parent(s): 3f1e89d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -5,7 +5,11 @@ from huggingface_hub import InferenceClient
5
  """
6
  For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
7
  """
8
- client = InferenceClient("google/gemma-2-2b")
 
 
 
 
9
 
10
  @spaces.GPU(duration=60)
11
  def respond(
 
5
  """
6
  For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
7
  """
8
+ token = os.getenv("HUGGINGFACE_TOKEN")
9
+ if token =="":
10
+ raise ValueError("HUGGINGFACE_TOKEN environment variable is not set")
11
+
12
+ client = InferenceClient("google/gemma-2-2b",token = token)
13
 
14
  @spaces.GPU(duration=60)
15
  def respond(