sh20raj commited on
Commit
4adde4d
·
verified ·
1 Parent(s): 1db9861

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -1
app.py CHANGED
@@ -1 +1,19 @@
1
- print("Hlw World")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import ollama
3
+
4
+ def main():
5
+ st.title("Llama Chatbot")
6
+
7
+ user_input = st.text_input("You:", "Why is the sky blue?")
8
+
9
+ if st.button("Ask"):
10
+ with st.spinner("Thinking..."):
11
+ response = ollama.chat(model='llama2', messages=[{
12
+ 'role': 'user',
13
+ 'content': user_input,
14
+ }])
15
+ st.success("Llama says:")
16
+ st.write(response['message']['content'])
17
+
18
+ if __name__ == "__main__":
19
+ main()