Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -736,8 +736,24 @@ agent = smolagents.CodeAgent(
|
|
| 736 |
verbosity_level=2, # show steps in logs for class demo
|
| 737 |
)
|
| 738 |
|
| 739 |
-
with gr.Blocks(
|
| 740 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 741 |
chat = gr.Chatbot(height=420)
|
| 742 |
inp = gr.Textbox(placeholder="Ask your question in natural language.", label="Your question")
|
| 743 |
|
|
@@ -754,15 +770,17 @@ with gr.Blocks(title="TechSpark Agent") as demo:
|
|
| 754 |
return "", history
|
| 755 |
|
| 756 |
gr.Examples(
|
| 757 |
-
fn=respond,
|
| 758 |
examples=[
|
| 759 |
"Who is Ed?",
|
| 760 |
"Who to talk to to create a wooden table?",
|
| 761 |
-
"
|
| 762 |
],
|
| 763 |
-
inputs=[inp]
|
|
|
|
|
|
|
|
|
|
| 764 |
)
|
| 765 |
|
| 766 |
inp.submit(respond, [inp, chat], [inp, chat])
|
| 767 |
|
| 768 |
-
demo.launch(share=True)
|
|
|
|
| 736 |
verbosity_level=2, # show steps in logs for class demo
|
| 737 |
)
|
| 738 |
|
| 739 |
+
with gr.Blocks(theme=gr.themes.Ocean()) as demo:
|
| 740 |
+
|
| 741 |
+
# Centered title and description using HTML
|
| 742 |
+
gr.HTML("""
|
| 743 |
+
<div style="text-align: center; font-family: 'Arial', sans-serif;">
|
| 744 |
+
<h1 style="color:#1f77b4; margin-bottom: 20px; font-weight: 300;">
|
| 745 |
+
🤖 TechSpark AI Assistant
|
| 746 |
+
</h1>
|
| 747 |
+
|
| 748 |
+
<p style="margin-top: 0; font-weight: 300; font-size: 16px; color:#555;">
|
| 749 |
+
Welcome to the TechSpark AI Assistant!<br>
|
| 750 |
+
Ask anything about TechSpark staff, tools, courses or location of tools.<br>
|
| 751 |
+
This assistant is powered by OpenAI's GPT model via smolagents,
|
| 752 |
+
accessing accurate information from our curated dataset verified by TechSpark staff!
|
| 753 |
+
</p>
|
| 754 |
+
</div>
|
| 755 |
+
""")
|
| 756 |
+
|
| 757 |
chat = gr.Chatbot(height=420)
|
| 758 |
inp = gr.Textbox(placeholder="Ask your question in natural language.", label="Your question")
|
| 759 |
|
|
|
|
| 770 |
return "", history
|
| 771 |
|
| 772 |
gr.Examples(
|
|
|
|
| 773 |
examples=[
|
| 774 |
"Who is Ed?",
|
| 775 |
"Who to talk to to create a wooden table?",
|
| 776 |
+
"How can I access laser cutter?"
|
| 777 |
],
|
| 778 |
+
inputs=[inp],
|
| 779 |
+
outputs=[inp, chat],
|
| 780 |
+
fn=respond,
|
| 781 |
+
cache_examples=False, # Set to False for dynamic content or to avoid caching issues
|
| 782 |
)
|
| 783 |
|
| 784 |
inp.submit(respond, [inp, chat], [inp, chat])
|
| 785 |
|
| 786 |
+
demo.launch(share=True)
|