Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -21,16 +21,14 @@ prompt = ChatPromptTemplate.from_messages(
|
|
21 |
]
|
22 |
)
|
23 |
|
24 |
-
# Streamlit app
|
25 |
-
st.title('Langchain Demo With
|
|
|
|
|
26 |
input_text = st.text_input("Search the topic you want")
|
27 |
|
28 |
-
# Ollama
|
29 |
-
|
30 |
-
llm = Ollama(
|
31 |
-
model="llama2",
|
32 |
-
server_url=os.getenv("OLLAMA_SERVER_URL", "http://localhost:11434") # Add server URL to env
|
33 |
-
)
|
34 |
output_parser = StrOutputParser()
|
35 |
chain = prompt | llm | output_parser
|
36 |
|
|
|
21 |
]
|
22 |
)
|
23 |
|
24 |
+
# Streamlit app setup
|
25 |
+
st.title('Langchain Demo With LLAMA2 API')
|
26 |
+
|
27 |
+
# User input
|
28 |
input_text = st.text_input("Search the topic you want")
|
29 |
|
30 |
+
# Ollama LLM (ensure the model is available, or access it through Hugging Face API)
|
31 |
+
llm = Ollama(model="llama2")
|
|
|
|
|
|
|
|
|
32 |
output_parser = StrOutputParser()
|
33 |
chain = prompt | llm | output_parser
|
34 |
|