Nina
commited on
Commit
Β·
65067f0
1
Parent(s):
51d6e66
add textbox for feedback
Browse files
app.py
CHANGED
|
@@ -89,6 +89,10 @@ def gen_conv(query: str, report_type, history=[system_template], ipcc=True):
|
|
| 89 |
return gradio_format, messages, sources
|
| 90 |
|
| 91 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
# Gradio
|
| 93 |
css_code = ".gradio-container {background-image: url('file=background.png');background-position: top right}"
|
| 94 |
|
|
@@ -99,7 +103,7 @@ with gr.Blocks(title="π ClimateGPT Ekimetrics", css=css_code) as demo:
|
|
| 99 |
user_id = gr.State([get_random_string(10)])
|
| 100 |
|
| 101 |
with gr.Tab("App"):
|
| 102 |
-
gr.Markdown("
|
| 103 |
gr.Markdown(
|
| 104 |
""" Climate GPT is an interactive exploration tool designed to help you easily find relevant information based on of Environmental reports such as IPCCs and other environmental reports.
|
| 105 |
\n **How does it work:** This Chatbot is a combination of two technologies. FAISS search applied to a vast amount of scientific climate reports and TurboGPT to generate human-like text from the part of the document extracted from the database.
|
|
@@ -140,6 +144,9 @@ with gr.Blocks(title="π ClimateGPT Ekimetrics", css=css_code) as demo:
|
|
| 140 |
)
|
| 141 |
with gr.Accordion("Feedbacks", open=False):
|
| 142 |
gr.Markdown("Please complete some feedbacks π")
|
|
|
|
|
|
|
|
|
|
| 143 |
|
| 144 |
with gr.Accordion("Add your personal openai api key - Option", open=False):
|
| 145 |
openai_api_key_textbox = gr.Textbox(
|
|
|
|
| 89 |
return gradio_format, messages, sources
|
| 90 |
|
| 91 |
|
| 92 |
+
def test(feed: str):
|
| 93 |
+
print(feed)
|
| 94 |
+
|
| 95 |
+
|
| 96 |
# Gradio
|
| 97 |
css_code = ".gradio-container {background-image: url('file=background.png');background-position: top right}"
|
| 98 |
|
|
|
|
| 103 |
user_id = gr.State([get_random_string(10)])
|
| 104 |
|
| 105 |
with gr.Tab("App"):
|
| 106 |
+
gr.Markdown("# Welcome to Climate GPT π !")
|
| 107 |
gr.Markdown(
|
| 108 |
""" Climate GPT is an interactive exploration tool designed to help you easily find relevant information based on of Environmental reports such as IPCCs and other environmental reports.
|
| 109 |
\n **How does it work:** This Chatbot is a combination of two technologies. FAISS search applied to a vast amount of scientific climate reports and TurboGPT to generate human-like text from the part of the document extracted from the database.
|
|
|
|
| 144 |
)
|
| 145 |
with gr.Accordion("Feedbacks", open=False):
|
| 146 |
gr.Markdown("Please complete some feedbacks π")
|
| 147 |
+
feedback = gr.Textbox()
|
| 148 |
+
feedback_save = gr.Button(value="submit feedback")
|
| 149 |
+
feedback_save.click(test, inputs=[feedback])
|
| 150 |
|
| 151 |
with gr.Accordion("Add your personal openai api key - Option", open=False):
|
| 152 |
openai_api_key_textbox = gr.Textbox(
|