Update app.py
Browse files
app.py
CHANGED
|
@@ -1 +1,19 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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()
|