spencer commited on
Commit
d018247
1 Parent(s): a07f7af

use streamlit secrets for hf key

Browse files
Files changed (1) hide show
  1. models.py +4 -2
models.py CHANGED
@@ -2,12 +2,14 @@ import json
2
  from PIL import Image
3
 
4
  import requests
 
5
  from transformers import CLIPProcessor, CLIPModel
6
 
7
  from embeddings import logger
8
 
9
- with open("hf_api.key") as f:
10
- HF_TOKEN = f.read().strip()
 
11
 
12
 
13
  class HuggingFaceHosted:
 
2
  from PIL import Image
3
 
4
  import requests
5
+ import streamlit as st
6
  from transformers import CLIPProcessor, CLIPModel
7
 
8
  from embeddings import logger
9
 
10
+ HF_TOKEN = st.secrets["hf_api.key"]
11
+ #with open("hf_api.key") as f:
12
+ # HF_TOKEN = f.read().strip()
13
 
14
 
15
  class HuggingFaceHosted: