rushankg commited on
Commit
b55eee3
·
verified ·
1 Parent(s): 156507b

Added HUGGINGFACE_TOKEN to authenticate

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -1,6 +1,11 @@
1
  import streamlit as st
2
  from transformers import AutoTokenizer, AutoModelForCausalLM
3
  import torch
 
 
 
 
 
4
 
5
  # Load the tokenizer and model from Hugging Face
6
  @st.cache_resource
 
1
  import streamlit as st
2
  from transformers import AutoTokenizer, AutoModelForCausalLM
3
  import torch
4
+ from huggingface_hub import login
5
+
6
+ # Authenticate with Hugging Face using the environment variable
7
+ huggingface_token = os.getenv("HUGGINGFACE_TOKEN")
8
+ login(token=huggingface_token)
9
 
10
  # Load the tokenizer and model from Hugging Face
11
  @st.cache_resource