baconnier commited on
Commit
81e533a
·
verified ·
1 Parent(s): 7eda452

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -0
app.py CHANGED
@@ -1,9 +1,17 @@
1
  import gradio as gr
2
  from huggingface_hub import InferenceClient
 
3
 
4
  """
5
  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
6
  """
 
 
 
 
 
 
 
7
  client = InferenceClient("meta-llama/Meta-Llama-3-70B-Instruct")
8
 
9
  system_message="""
 
1
  import gradio as gr
2
  from huggingface_hub import InferenceClient
3
+ import os
4
 
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
+
9
+ # Main code to run the application
10
+ if __name__ == '__main__':
11
+ api_token = os.getenv('HF_API_TOKEN')
12
+ if not api_token:
13
+ raise ValueError("HF_API_TOKEN not found in environment variables")
14
+
15
  client = InferenceClient("meta-llama/Meta-Llama-3-70B-Instruct")
16
 
17
  system_message="""