Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
CHANGED
|
@@ -6,8 +6,9 @@ import faiss
|
|
| 6 |
import numpy as np
|
| 7 |
import streamlit as st
|
| 8 |
|
| 9 |
-
# Authenticate with Hugging Face using
|
| 10 |
-
|
|
|
|
| 11 |
|
| 12 |
# Initialize a question-answering model
|
| 13 |
question_answerer = pipeline("question-answering", model="distilbert-base-cased-distilled-squad")
|
|
|
|
| 6 |
import numpy as np
|
| 7 |
import streamlit as st
|
| 8 |
|
| 9 |
+
# Authenticate with Hugging Face using the API key from environment variables
|
| 10 |
+
# If running on Hugging Face Spaces, make sure the API key is stored as a secret.
|
| 11 |
+
login(os.environ["HF_API_KEY"])
|
| 12 |
|
| 13 |
# Initialize a question-answering model
|
| 14 |
question_answerer = pipeline("question-answering", model="distilbert-base-cased-distilled-squad")
|