andreska commited on
Commit
2295d00
·
verified ·
1 Parent(s): 0bbfee7

Test starting InferenceAPI with key

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -1,4 +1,10 @@
1
  import streamlit as st
2
 
3
  x = st.slider('Select a value')
4
- st.write(x, 'squared is', x * x)
 
 
 
 
 
 
 
1
  import streamlit as st
2
 
3
  x = st.slider('Select a value')
4
+ st.write(x, 'squared is', x * x)
5
+
6
+ # Get the API key from the environment variable
7
+ api_key = st.secrets("InferenceKey")
8
+
9
+ # Initialize the Inference API with your model and API key
10
+ api = InferenceApi(repo_id="gpt-3", token=api_key)