Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,14 @@
|
|
1 |
import streamlit as st
|
2 |
import requests
|
|
|
3 |
|
4 |
# Hugging Face API details
|
5 |
API_URL = "https://api-inference.huggingface.co/models/facebook/blenderbot-400M-distill"
|
6 |
-
|
|
|
|
|
|
|
|
|
7 |
|
8 |
# Function to query the model
|
9 |
def query(payload):
|
|
|
1 |
import streamlit as st
|
2 |
import requests
|
3 |
+
import os
|
4 |
|
5 |
# Hugging Face API details
|
6 |
API_URL = "https://api-inference.huggingface.co/models/facebook/blenderbot-400M-distill"
|
7 |
+
|
8 |
+
# Access the secret API key stored as 'rag'
|
9 |
+
api_key = os.getenv('rag')
|
10 |
+
|
11 |
+
headers = {"Authorization": f"Bearer {api_key}"}
|
12 |
|
13 |
# Function to query the model
|
14 |
def query(payload):
|