Exched commited on
Commit
04e8c14
1 Parent(s): c8642b7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -1,10 +1,14 @@
1
  import os
2
  from transformers import AutoModelForCausalLM, AutoTokenizer
3
  import gradio as gr
 
4
 
5
  # Load the Hugging Face API token from environment variables
6
  hf_token = os.getenv("HF_TOKEN")
7
 
 
 
 
8
  # Model name
9
  model_name = "meta-llama/Llama-2-7b-chat-hf"
10
 
 
1
  import os
2
  from transformers import AutoModelForCausalLM, AutoTokenizer
3
  import gradio as gr
4
+ from huggingface_hub import login
5
 
6
  # Load the Hugging Face API token from environment variables
7
  hf_token = os.getenv("HF_TOKEN")
8
 
9
+ # Login to huggingface_hub using the token
10
+ login(token=hf_token)
11
+
12
  # Model name
13
  model_name = "meta-llama/Llama-2-7b-chat-hf"
14