Upload 2 files
Browse files- app.py +13 -0
- requirements.txt +3 -0
app.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from langchain_community.llms import Ollama
|
| 2 |
+
import streamlit as st
|
| 3 |
+
|
| 4 |
+
llm = Ollama(model="llama3:70b")
|
| 5 |
+
|
| 6 |
+
st.title("Chatbot using Llama3")
|
| 7 |
+
|
| 8 |
+
prompt = st.text_area("Enter your prompt:")
|
| 9 |
+
|
| 10 |
+
if st.button("Generate"):
|
| 11 |
+
if prompt:
|
| 12 |
+
with st.spinner("Generating response..."):
|
| 13 |
+
st.write_stream(llm.stream(prompt, stop=['<|eot_id|>']))
|
requirements.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
langchain
|
| 2 |
+
langchain_community
|
| 3 |
+
streamlit
|