-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
44 lines (30 loc) · 938 Bytes
/
main.py
File metadata and controls
44 lines (30 loc) · 938 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import streamlit as st
import ollama
import os, sys
page_bg_img= """
<style>
[data-testid = "stAppVeiwContainer"]
{
linear-gradient( 45deg, #f745e8, #f745e8 5px, #e5e5f7 5px, #e5e5f7 25px );
}
</style>
"""
st.markdown(page_bg_img, unsafe_allow_html=True)
st.sidebar.image("icon1.png")
#st.sidebar.header("Options")
#text =st.sidebar.text_area('Paste here')
st.header("hello I'm BRaiNWAVE an AI assistant for all your needs...@Your service")
#input for the prompt
prompt = st.chat_input("Ask away.>>")
if prompt:
#display output from user
with st.chat_message("user"):
st.write(prompt)
#processing
with st.spinner("Tastes like knowledge"):
result = ollama.chat(model="llama2", messages=[{
"role":"assistant",
"content":prompt,
}])
response = result["message"]["content"]
st.write(response + " And always remember BRaiNWAVE loves you!")