Update BrainBot.py
Browse files- BrainBot.py +7 -0
BrainBot.py
CHANGED
|
@@ -3,6 +3,7 @@ import requests
|
|
| 3 |
import tempfile
|
| 4 |
import validators
|
| 5 |
import os
|
|
|
|
| 6 |
|
| 7 |
# Custom CSS
|
| 8 |
with open('styles.css') as f:
|
|
@@ -10,6 +11,12 @@ with open('styles.css') as f:
|
|
| 10 |
|
| 11 |
st.markdown(f'<style>{css}</style>', unsafe_allow_html=True)
|
| 12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
## FUNCTIONS
|
| 14 |
## -------------------------------------------------------------------------------------------
|
| 15 |
# Function to save the uploaded file as a temporary file and return its path.
|
|
|
|
| 3 |
import tempfile
|
| 4 |
import validators
|
| 5 |
import os
|
| 6 |
+
from huggingface_hub import login
|
| 7 |
|
| 8 |
# Custom CSS
|
| 9 |
with open('styles.css') as f:
|
|
|
|
| 11 |
|
| 12 |
st.markdown(f'<style>{css}</style>', unsafe_allow_html=True)
|
| 13 |
|
| 14 |
+
## LOGIN TO HF
|
| 15 |
+
## -------------------------------------------------------------------------------------------
|
| 16 |
+
# Login to Hugging Face with Access Token
|
| 17 |
+
access_token = os.getenv('HF_TOKEN')
|
| 18 |
+
login(token = access_token)
|
| 19 |
+
|
| 20 |
## FUNCTIONS
|
| 21 |
## -------------------------------------------------------------------------------------------
|
| 22 |
# Function to save the uploaded file as a temporary file and return its path.
|