gasbaoui commited on
Commit
15364b8
1 Parent(s): f2d62a1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -1,14 +1,14 @@
1
  import streamlit as st
2
  import requests
3
- from huggingface_hub import hf
 
 
4
 
5
- # Retrieve your API key from the Secrets Manager
6
- api_key = hf.secrets.get("testing")
7
 
8
  API_URL_SEMANTICS = "https://api-inference.huggingface.co/models/Salesforce/blip-image-captioning-large"
9
  API_URL_CAPTION = "https://api-inference.huggingface.co/models/mistralai/Mistral-7B-Instruct-v0.2"
10
 
11
- headers = {"Authorization": f"Bearer api_key"}
12
  st.set_page_config(page_title="Instagram Post Improvement")
13
  def generateSemantic(file):
14
  response = requests.post(API_URL_SEMANTICS, headers=headers, data=file)
 
1
  import streamlit as st
2
  import requests
3
+ from dotenv import load_dotenv
4
+ import os
5
+ load_dotenv()
6
 
 
 
7
 
8
  API_URL_SEMANTICS = "https://api-inference.huggingface.co/models/Salesforce/blip-image-captioning-large"
9
  API_URL_CAPTION = "https://api-inference.huggingface.co/models/mistralai/Mistral-7B-Instruct-v0.2"
10
 
11
+ headers = {"Authorization": f"Bearer {os.getenv('api_key')}"}
12
  st.set_page_config(page_title="Instagram Post Improvement")
13
  def generateSemantic(file):
14
  response = requests.post(API_URL_SEMANTICS, headers=headers, data=file)