Update app.py
Browse files
app.py
CHANGED
@@ -14,13 +14,20 @@ def CustomChatGPT(Question):
|
|
14 |
ChatGPT_reply = response["choices"][0]["message"]["content"]
|
15 |
messages.append({"role": "assistant", "content": ChatGPT_reply})
|
16 |
return ChatGPT_reply
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
demo = gr.Interface(
|
19 |
fn=CustomChatGPT,
|
20 |
inputs=gr.Textbox(label="Insert jargon here (ask a question):", placeholder="E.g. What are gas fees?"),
|
21 |
outputs=gr.Textbox(label="Get a simple answer in return:"),
|
22 |
-
|
23 |
-
title="Web(GPT)3"
|
|
|
24 |
)
|
25 |
|
26 |
demo.launch()
|
|
|
14 |
ChatGPT_reply = response["choices"][0]["message"]["content"]
|
15 |
messages.append({"role": "assistant", "content": ChatGPT_reply})
|
16 |
return ChatGPT_reply
|
17 |
+
|
18 |
+
def set_theme(dark_theme):
|
19 |
+
if dark_theme:
|
20 |
+
return dark_theme_css
|
21 |
+
else:
|
22 |
+
return light_theme_css
|
23 |
+
|
24 |
demo = gr.Interface(
|
25 |
fn=CustomChatGPT,
|
26 |
inputs=gr.Textbox(label="Insert jargon here (ask a question):", placeholder="E.g. What are gas fees?"),
|
27 |
outputs=gr.Textbox(label="Get a simple answer in return:"),
|
28 |
+
gr.inputs.Checkbox(label="Dark Theme", default=False),
|
29 |
+
title="Web(GPT)3",
|
30 |
+
css=set_theme
|
31 |
)
|
32 |
|
33 |
demo.launch()
|