Mr-Geo commited on
Commit
c60edcb
Β·
verified Β·
1 Parent(s): 2a28cee

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -11
app.py CHANGED
@@ -519,10 +519,10 @@ if __name__ == "__main__":
519
  gr.Markdown("Accesses text data from 11,982 unique BAS URLs (6GB [Vector Database](https://huggingface.co/datasets/Mr-Geo/chroma_db/tree/main/) πŸ“š extracted 02/02/2025) Created with open source technologies: [Gradio](https://gradio.app) for UI 🎨, [Hugging Face](https://huggingface.co/) models for embeddings ⚑, and [Chroma](https://www.trychroma.com/) as the vector database πŸ’»")
520
  model_selector = gr.Dropdown(
521
  choices=[
522
- "llama-3.3-70b-versatile",
523
- "meta-llama/llama-4-maverick-17b-128e-instruct",
524
- "mistral-saba-24b",
525
- "deepseek-r1-distill-llama-70b"
526
  ],
527
  value="llama-3.3-70b-versatile",
528
  label="Select AI Large Language Model πŸ€–",
@@ -533,12 +533,12 @@ if __name__ == "__main__":
533
  with gr.Row(equal_height=True):
534
  msg = gr.Textbox(
535
  placeholder="What would you like to know about BAS? Or choose an example question...❓",
536
- label="Your question",
537
  show_label=True,
538
  container=True,
539
- scale=20
 
540
  )
541
- send = gr.Button("Send ⬆️", scale=1, min_width=50)
542
  clear = gr.Button("Clear Chat History 🧹 (Click here if any errors are returned and ask question again)")
543
 
544
  gr.Examples(
@@ -567,16 +567,14 @@ if __name__ == "__main__":
567
  msg.submit(user, [msg, chatbot], [msg, chatbot], queue=False).then(
568
  bot, [chatbot, model_selector], chatbot
569
  )
570
- send.click(user, [msg, chatbot], [msg, chatbot], queue=False).then(
571
- bot, [chatbot, model_selector], chatbot
572
- )
573
 
574
  clear.click(lambda: [], None, chatbot, queue=False) # Updated to return empty list
575
  gr.Markdown("<footer style='text-align: center; margin-top: 5px;'>πŸ€– AI-generated content; while the Chat Assistant strives for accuracy, errors may occur; please thoroughly check critical information πŸ€–<br>⚠️ <strong><u>Disclaimer: This system was not produced by the British Antarctic Survey (BAS) and AI generated output does not reflect the views or opinions of BAS</u></strong> ⚠️ <br>(just a bit of fun :D)</footer>")
576
  demo.launch(
577
  server_name="0.0.0.0",
578
  server_port=7860,
579
- share=False
 
580
  )
581
 
582
  except Exception as e:
 
519
  gr.Markdown("Accesses text data from 11,982 unique BAS URLs (6GB [Vector Database](https://huggingface.co/datasets/Mr-Geo/chroma_db/tree/main/) πŸ“š extracted 02/02/2025) Created with open source technologies: [Gradio](https://gradio.app) for UI 🎨, [Hugging Face](https://huggingface.co/) models for embeddings ⚑, and [Chroma](https://www.trychroma.com/) as the vector database πŸ’»")
520
  model_selector = gr.Dropdown(
521
  choices=[
522
+ ("Llama 3.3 - Versatile πŸ¦™βœ¨", "llama-3.3-70b-versatile"),
523
+ ("Llama 4 - Latest πŸš€", "meta-llama/llama-4-scout-17b-16e-instruct"),
524
+ ("Mistral Saba - Balanced βš–οΈ", "mistral-saba-24b"),
525
+ ("DeepSeek - Reasoning πŸ§ πŸ”", "deepseek-r1-distill-llama-70b")
526
  ],
527
  value="llama-3.3-70b-versatile",
528
  label="Select AI Large Language Model πŸ€–",
 
533
  with gr.Row(equal_height=True):
534
  msg = gr.Textbox(
535
  placeholder="What would you like to know about BAS? Or choose an example question...❓",
536
+ label="Your question πŸ€”",
537
  show_label=True,
538
  container=True,
539
+ submit_btn=True,
540
+ scale=20,
541
  )
 
542
  clear = gr.Button("Clear Chat History 🧹 (Click here if any errors are returned and ask question again)")
543
 
544
  gr.Examples(
 
567
  msg.submit(user, [msg, chatbot], [msg, chatbot], queue=False).then(
568
  bot, [chatbot, model_selector], chatbot
569
  )
 
 
 
570
 
571
  clear.click(lambda: [], None, chatbot, queue=False) # Updated to return empty list
572
  gr.Markdown("<footer style='text-align: center; margin-top: 5px;'>πŸ€– AI-generated content; while the Chat Assistant strives for accuracy, errors may occur; please thoroughly check critical information πŸ€–<br>⚠️ <strong><u>Disclaimer: This system was not produced by the British Antarctic Survey (BAS) and AI generated output does not reflect the views or opinions of BAS</u></strong> ⚠️ <br>(just a bit of fun :D)</footer>")
573
  demo.launch(
574
  server_name="0.0.0.0",
575
  server_port=7860,
576
+ share=False,
577
+ show_api=False
578
  )
579
 
580
  except Exception as e: