Spaces:
Runtime error
Runtime error
Hiding your API Key
Browse files
app.py
CHANGED
|
@@ -13,8 +13,8 @@ import os
|
|
| 13 |
## Function to load OpenAI model and get responses
|
| 14 |
|
| 15 |
def get_openai_response(question, input_key):
|
| 16 |
-
print('\n\n\n\\n')
|
| 17 |
llm = OpenAI(openai_api_key=input_key,
|
|
|
|
| 18 |
#model_name="gpt-3.5-turbo-instruct",
|
| 19 |
temperature=0.5)
|
| 20 |
|
|
@@ -27,7 +27,7 @@ st.set_page_config(page_title = "Q&A Demo")
|
|
| 27 |
|
| 28 |
st.header("Langchain Application")
|
| 29 |
|
| 30 |
-
input_key = st.text_input("Enter OpenAI Key: ", key="input_key")
|
| 31 |
|
| 32 |
input = st.text_input("Input Question: ", key="input")
|
| 33 |
|
|
@@ -44,3 +44,6 @@ if input_key != "":
|
|
| 44 |
st.write(response)
|
| 45 |
except:
|
| 46 |
st.write("Incorrect API Key")
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
## Function to load OpenAI model and get responses
|
| 14 |
|
| 15 |
def get_openai_response(question, input_key):
|
|
|
|
| 16 |
llm = OpenAI(openai_api_key=input_key,
|
| 17 |
+
# Currently uses Base Model
|
| 18 |
#model_name="gpt-3.5-turbo-instruct",
|
| 19 |
temperature=0.5)
|
| 20 |
|
|
|
|
| 27 |
|
| 28 |
st.header("Langchain Application")
|
| 29 |
|
| 30 |
+
input_key = st.text_input("Enter OpenAI Key: ", key="input_key", type="password")
|
| 31 |
|
| 32 |
input = st.text_input("Input Question: ", key="input")
|
| 33 |
|
|
|
|
| 44 |
st.write(response)
|
| 45 |
except:
|
| 46 |
st.write("Incorrect API Key")
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
|