Carlos Rosas commited on
Commit
69ffa48
·
verified ·
1 Parent(s): 8184f41

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -13
app.py CHANGED
@@ -97,14 +97,14 @@ class pleiasBot:
97
  analysis = parts[0].strip()
98
  answer = parts[1].replace("<|answer_start|>", "").replace("<|answer_end|>", "").strip()
99
 
100
- # Format each section separately
101
- analysis_text = f'<div class="generation">' + format_references(analysis) + "</div>"
102
- answer_text = '<h2 style="text-align:center">Réponse</h3>\n<div class="generation">' + format_references(answer) + "</div>"
103
  else:
104
  analysis_text = ""
105
  answer_text = format_references(generated_text)
106
 
107
- fiches_html = '<h2 style="text-align:center">Sources</h3>\n' + fiches_html
108
  return analysis_text, answer_text, fiches_html
109
 
110
  except Exception as e:
@@ -216,7 +216,7 @@ demo = gr.Blocks(css=css)
216
  with demo:
217
  # Header with black bar
218
  gr.HTML("""
219
- <div style="display: flex; justify-content: center; width: 100%; background-color: black; padding: 7px 0;">
220
  <pre style="font-family: monospace; line-height: 1.2; font-size: 24px; color: #00ffea; margin: 0;">
221
  ╔═══════════════════╗
222
  ║ pleias-RAG 1.0 ║
@@ -225,18 +225,17 @@ with demo:
225
  </div>
226
  """)
227
 
228
- # Input section
229
- with gr.Column(scale=2):
230
- text_input = gr.Textbox(label="Votre question ou votre instruction", lines=3)
231
- text_button = gr.Button("Interroger pleias-RAG")
232
-
233
- # Two columns for output: Analysis and Response
234
  with gr.Row():
 
235
  with gr.Column(scale=2):
236
- text_output = gr.HTML(label="Analyse des sources")
237
- with gr.Column(scale=3):
238
  response_output = gr.HTML(label="Réponse")
239
 
 
 
 
 
240
  # Sources at the bottom
241
  with gr.Row():
242
  embedding_output = gr.HTML(label="Les sources utilisées")
 
97
  analysis = parts[0].strip()
98
  answer = parts[1].replace("<|answer_start|>", "").replace("<|answer_end|>", "").strip()
99
 
100
+ # Format each section with matching h2 titles
101
+ analysis_text = '<h2 style="text-align:center">Analyse des sources</h2>\n<div class="generation">' + format_references(analysis) + "</div>"
102
+ answer_text = '<h2 style="text-align:center">Réponse</h2>\n<div class="generation">' + format_references(answer) + "</div>"
103
  else:
104
  analysis_text = ""
105
  answer_text = format_references(generated_text)
106
 
107
+ fiches_html = '<h2 style="text-align:center">Sources</h2>\n' + fiches_html
108
  return analysis_text, answer_text, fiches_html
109
 
110
  except Exception as e:
 
216
  with demo:
217
  # Header with black bar
218
  gr.HTML("""
219
+ <div style="display: flex; justify-content: center; width: 100%; background-color: black; padding: 10px 0;">
220
  <pre style="font-family: monospace; line-height: 1.2; font-size: 24px; color: #00ffea; margin: 0;">
221
  ╔═══════════════════╗
222
  ║ pleias-RAG 1.0 ║
 
225
  </div>
226
  """)
227
 
 
 
 
 
 
 
228
  with gr.Row():
229
+ # Left column for input, button and answer
230
  with gr.Column(scale=2):
231
+ text_input = gr.Textbox(label="Votre question ou votre instruction", lines=3)
232
+ text_button = gr.Button("Interroger pleias-RAG")
233
  response_output = gr.HTML(label="Réponse")
234
 
235
+ # Right column for analysis
236
+ with gr.Column(scale=3):
237
+ text_output = gr.HTML(label="Analyse des sources")
238
+
239
  # Sources at the bottom
240
  with gr.Row():
241
  embedding_output = gr.HTML(label="Les sources utilisées")