Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -86,26 +86,26 @@ def explain_term(term):
|
|
86 |
|
87 |
st.title('FinChat')
|
88 |
|
89 |
-
api_key = st.text_input("Enter your OpenAI API key:", type="password")
|
90 |
|
91 |
-
if api_key:
|
92 |
-
|
93 |
-
|
94 |
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
|
103 |
-
|
104 |
|
105 |
-
|
106 |
-
|
107 |
-
else:
|
108 |
-
|
109 |
|
110 |
uploaded_file = st.file_uploader("Choose a PDF file", type="pdf")
|
111 |
|
|
|
86 |
|
87 |
st.title('FinChat')
|
88 |
|
89 |
+
# api_key = st.text_input("Enter your OpenAI API key:", type="password")
|
90 |
|
91 |
+
# if api_key:
|
92 |
+
# try:
|
93 |
+
# openai.api_key = api_key
|
94 |
|
95 |
+
# openai.ChatCompletion.create(
|
96 |
+
# model="gpt-4-1106-preview",
|
97 |
+
# messages=[
|
98 |
+
# {"role": "system", "content": "You are a helpful assistant."},
|
99 |
+
# {"role": "user", "content": "Hello"},
|
100 |
+
# ],
|
101 |
+
# )
|
102 |
|
103 |
+
# st.success("API key is valid!")
|
104 |
|
105 |
+
# except Exception as e:
|
106 |
+
# st.error(f"Failed to validate API key: {e}")
|
107 |
+
# else:
|
108 |
+
# st.warning("Please enter your OpenAI API key.")
|
109 |
|
110 |
uploaded_file = st.file_uploader("Choose a PDF file", type="pdf")
|
111 |
|