Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
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-
|
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 |
-
|
|
|
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:
|