Update app.py
Browse files
app.py
CHANGED
@@ -45,9 +45,9 @@ def set_openai_api_key(api_key: str):
|
|
45 |
If no api_key, then None is returned.
|
46 |
"""
|
47 |
if api_key:
|
48 |
-
|
49 |
chain = get_chain(vectorstore)
|
50 |
-
|
51 |
return chain
|
52 |
|
53 |
class ChatWrapper:
|
@@ -83,7 +83,7 @@ block = gr.Blocks(css=".gradio-container {background-color: lightgray}")
|
|
83 |
|
84 |
with block:
|
85 |
with gr.Row():
|
86 |
-
gr.Markdown("<h3><center>Chat-Your-Data (
|
87 |
|
88 |
openai_api_key_textbox = gr.Textbox(
|
89 |
placeholder="Paste your OpenAI API key (sk-...)",
|
@@ -97,7 +97,7 @@ with block:
|
|
97 |
with gr.Row():
|
98 |
message = gr.Textbox(
|
99 |
label="What's your question?",
|
100 |
-
placeholder="Ask questions about Investing
|
101 |
lines=1,
|
102 |
)
|
103 |
submit = gr.Button(value="Send", variant="secondary").style(full_width=False)
|
|
|
45 |
If no api_key, then None is returned.
|
46 |
"""
|
47 |
if api_key:
|
48 |
+
os.environ["OPENAI_API_KEY"] = api_key
|
49 |
chain = get_chain(vectorstore)
|
50 |
+
os.environ["OPENAI_API_KEY"] = ""
|
51 |
return chain
|
52 |
|
53 |
class ChatWrapper:
|
|
|
83 |
|
84 |
with block:
|
85 |
with gr.Row():
|
86 |
+
gr.Markdown("<h3><center>Chat-Your-Data (Investment Management)</center></h3>")
|
87 |
|
88 |
openai_api_key_textbox = gr.Textbox(
|
89 |
placeholder="Paste your OpenAI API key (sk-...)",
|
|
|
97 |
with gr.Row():
|
98 |
message = gr.Textbox(
|
99 |
label="What's your question?",
|
100 |
+
placeholder="Ask questions about Investing",
|
101 |
lines=1,
|
102 |
)
|
103 |
submit = gr.Button(value="Send", variant="secondary").style(full_width=False)
|