aquibmoin commited on
Commit
0136c25
1 Parent(s): a18637e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -221,6 +221,13 @@ def export_to_word(response_content):
221
  cell.text = cell_text.strip()
222
  # Apply text wrapping for each cell
223
  cell._element.get_or_add_tcPr().append(parse_xml(r'<w:tcW w:w="2500" w:type="pct" ' + nsdecls('w') + '/>'))
 
 
 
 
 
 
 
224
  else:
225
  # For any other section, add the text as-is (no special formatting)
226
  doc.add_paragraph(section.strip())
@@ -346,8 +353,8 @@ def chatbot(user_input, context="", use_encoder=False, max_tokens=150, temperatu
346
  iface = gr.Interface(
347
  fn=chatbot,
348
  inputs=[
349
- gr.Textbox(lines=2, placeholder="Enter your Science Goal here...", label="Prompt ExosAI"),
350
- gr.Textbox(lines=5, placeholder="Enter some context here...", label="Context"),
351
  gr.Checkbox(label="Use NASA SMD Bi-Encoder for Context"),
352
  gr.Slider(50, 2000, value=150, step=10, label="Max Tokens"),
353
  gr.Slider(0.0, 1.0, value=0.7, step=0.1, label="Temperature"),
 
221
  cell.text = cell_text.strip()
222
  # Apply text wrapping for each cell
223
  cell._element.get_or_add_tcPr().append(parse_xml(r'<w:tcW w:w="2500" w:type="pct" ' + nsdecls('w') + '/>'))
224
+ elif section.startswith('ADS References'):
225
+ # Add the ADS References section as plain text
226
+ doc.add_heading('ADS References', level=1)
227
+ references = section.split('\n')[1:]
228
+ for reference in references:
229
+ if reference.strip():
230
+ doc.add_paragraph(reference.strip())
231
  else:
232
  # For any other section, add the text as-is (no special formatting)
233
  doc.add_paragraph(section.strip())
 
353
  iface = gr.Interface(
354
  fn=chatbot,
355
  inputs=[
356
+ gr.Textbox(lines=2, placeholder="Define your Subdomain...", label="Subdomain Definition"),
357
+ gr.Textbox(lines=5, placeholder="Enter your Science Goal...", label="Science Goal"),
358
  gr.Checkbox(label="Use NASA SMD Bi-Encoder for Context"),
359
  gr.Slider(50, 2000, value=150, step=10, label="Max Tokens"),
360
  gr.Slider(0.0, 1.0, value=0.7, step=0.1, label="Temperature"),