momenaca commited on
Commit
cb99a01
1 Parent(s): dcf594a

update frontend with login button

Browse files
Files changed (1) hide show
  1. app.py +19 -19
app.py CHANGED
@@ -201,7 +201,8 @@ theme = gr.themes.Base(
201
 
202
 
203
  init_prompt = """
204
- Hello, I am ESRS Q&A, a conversational assistant designed to help you understand the content of European Sustainability Reporting Standards (ESRS). I will answer your questions based **on the official definition of each ESRS as well as guidelines**.
 
205
  ⚠️ Limitations
206
  *Please note that this chatbot is in an early stage phase, it is not perfect and may sometimes give irrelevant answers. If you are not satisfied with the answer, please ask a more specific question or report your feedback to help us improve the system.*
207
 
@@ -210,16 +211,16 @@ What do you want to learn ?
210
 
211
 
212
  with gr.Blocks(title=f"{demo_name}", css=css, theme=theme) as demo:
213
- # gr.LoginButton()
214
- # with gr.Column() as bloc_1:
215
- # textbox_1 = gr.Textbox("You are not logged to Hugging Face !", show_label=False)
216
 
217
- # with gr.Column(visible=False) as bloc_3:
218
- # textbox_3 = gr.Textbox(
219
- # "You are not part of the ESRS Q&A Project, ask access here : https://huggingface.co/ekimetrics-esrsqa"
220
- # )
221
 
222
- with gr.Column(visible=True) as bloc_2:
223
  with gr.Tab("ESRS Q&A"):
224
  with gr.Row():
225
  with gr.Column(scale=2):
@@ -255,19 +256,18 @@ with gr.Blocks(title=f"{demo_name}", css=css, theme=theme) as demo:
255
  with gr.Column(scale=1):
256
  gr.Markdown("WIP")
257
 
258
- # demo.load(update_visible, inputs=None, outputs=[bloc_1, bloc_2, bloc_3])
259
- ask.submit(
260
- fn=chat,
261
- inputs=[
262
- ask,
263
- state,
264
- ],
265
- outputs=[ask, chatbot, state, sources_textbox],
266
- )
267
 
268
 
269
  demo.launch(
270
  share=True,
271
- # auth=("", ""),
272
  debug=True,
273
  )
 
201
 
202
 
203
  init_prompt = """
204
+ Hello, I am ESRS Q&A, a conversational assistant designed to help you understand the content of European Sustainability Reporting Standards (ESRS). I will answer your questions based **on the official definition of each ESRS as well as complementary guidelines**.
205
+
206
  ⚠️ Limitations
207
  *Please note that this chatbot is in an early stage phase, it is not perfect and may sometimes give irrelevant answers. If you are not satisfied with the answer, please ask a more specific question or report your feedback to help us improve the system.*
208
 
 
211
 
212
 
213
  with gr.Blocks(title=f"{demo_name}", css=css, theme=theme) as demo:
214
+ gr.LoginButton()
215
+ with gr.Column() as bloc_1:
216
+ textbox_1 = gr.Textbox("You are not logged to Hugging Face !", show_label=False)
217
 
218
+ with gr.Column(visible=False) as bloc_3:
219
+ textbox_3 = gr.Textbox(
220
+ "You are not part of the ESRS Q&A Project, if interested ask access here : https://huggingface.co/ekimetrics-esrsqa"
221
+ )
222
 
223
+ with gr.Column(visible=False) as bloc_2:
224
  with gr.Tab("ESRS Q&A"):
225
  with gr.Row():
226
  with gr.Column(scale=2):
 
256
  with gr.Column(scale=1):
257
  gr.Markdown("WIP")
258
 
259
+ demo.load(update_visible, inputs=None, outputs=[bloc_1, bloc_2, bloc_3])
260
+ ask.submit(
261
+ fn=chat,
262
+ inputs=[
263
+ ask,
264
+ state,
265
+ ],
266
+ outputs=[ask, chatbot, state, sources_textbox],
267
+ )
268
 
269
 
270
  demo.launch(
271
  share=True,
 
272
  debug=True,
273
  )