relaunch, secret_token seems not taken into account
Browse files
app.py
CHANGED
|
@@ -2,6 +2,7 @@ import streamlit as st
|
|
| 2 |
import requests
|
| 3 |
import os
|
| 4 |
import json
|
|
|
|
| 5 |
SECRET_TOKEN = os.getenv("SECRET_TOKEN")
|
| 6 |
|
| 7 |
API_URL = "https://api-inference.huggingface.co/models/microsoft/Orca-2-13b"
|
|
@@ -16,20 +17,19 @@ def query(input:str):
|
|
| 16 |
|
| 17 |
def main():
|
| 18 |
# Streamlit app title
|
| 19 |
-
st.text(json.dumps(headers))
|
| 20 |
st.title("Test orca2")
|
| 21 |
|
| 22 |
# Text input
|
| 23 |
user_input = st.text_area("Enter your question")
|
| 24 |
|
| 25 |
-
#
|
| 26 |
if st.button("Chat"):
|
| 27 |
# Perform sentiment analysis
|
| 28 |
response = query(user_input)
|
| 29 |
print(response)
|
| 30 |
|
| 31 |
# Display result
|
| 32 |
-
st.write(response)
|
| 33 |
|
| 34 |
if __name__ == "__main__":
|
| 35 |
main()
|
|
|
|
| 2 |
import requests
|
| 3 |
import os
|
| 4 |
import json
|
| 5 |
+
|
| 6 |
SECRET_TOKEN = os.getenv("SECRET_TOKEN")
|
| 7 |
|
| 8 |
API_URL = "https://api-inference.huggingface.co/models/microsoft/Orca-2-13b"
|
|
|
|
| 17 |
|
| 18 |
def main():
|
| 19 |
# Streamlit app title
|
|
|
|
| 20 |
st.title("Test orca2")
|
| 21 |
|
| 22 |
# Text input
|
| 23 |
user_input = st.text_area("Enter your question")
|
| 24 |
|
| 25 |
+
# Chat button
|
| 26 |
if st.button("Chat"):
|
| 27 |
# Perform sentiment analysis
|
| 28 |
response = query(user_input)
|
| 29 |
print(response)
|
| 30 |
|
| 31 |
# Display result
|
| 32 |
+
st.write(json.dumps(response))
|
| 33 |
|
| 34 |
if __name__ == "__main__":
|
| 35 |
main()
|