Spaces:
Running
Running
init
Browse files
app.py
CHANGED
|
@@ -114,26 +114,19 @@ elif page == "💡 Brainstorm Hub":
|
|
| 114 |
elif page == "🤖 AI Assistant":
|
| 115 |
st.title("🤖 Prospira AI Business Mentor")
|
| 116 |
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
if not self.model or not self.tokenizer:
|
| 131 |
-
return "LLM not initialized."
|
| 132 |
-
input_ids = self.tokenizer(prompt, return_tensors="pt").input_ids.to(self.model.device)
|
| 133 |
-
output = self.model.generate(input_ids, max_length=300)
|
| 134 |
-
return self.tokenizer.decode(output[0], skip_special_tokens=True)
|
| 135 |
-
|
| 136 |
-
assistant = LLaMAAssistant()
|
| 137 |
user_input = st.text_area("Ask Prospira AI for Business Advice:")
|
| 138 |
if st.button("Get AI Insights"):
|
| 139 |
response = assistant.generate_response(user_input)
|
|
|
|
| 114 |
elif page == "🤖 AI Assistant":
|
| 115 |
st.title("🤖 Prospira AI Business Mentor")
|
| 116 |
|
| 117 |
+
def render_chat():
|
| 118 |
+
st.header("💬 Business AI Assistant")
|
| 119 |
+
|
| 120 |
+
# Embed the Hugging Face Space iframe
|
| 121 |
+
st.write("""
|
| 122 |
+
<iframe
|
| 123 |
+
src="https://demoorganisation34-chatbot-for-prospira.hf.space"
|
| 124 |
+
frameborder="0"
|
| 125 |
+
width="850"
|
| 126 |
+
height="450"
|
| 127 |
+
></iframe>
|
| 128 |
+
""", unsafe_allow_html=True)
|
| 129 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 130 |
user_input = st.text_area("Ask Prospira AI for Business Advice:")
|
| 131 |
if st.button("Get AI Insights"):
|
| 132 |
response = assistant.generate_response(user_input)
|