Waseem771 commited on
Commit
72e4b93
·
verified ·
1 Parent(s): 4fe8d90

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -8
app.py CHANGED
@@ -21,16 +21,14 @@ prompt = ChatPromptTemplate.from_messages(
21
  ]
22
  )
23
 
24
- # Streamlit app
25
- st.title('Langchain Demo With Ollama Llama2 API')
 
 
26
  input_text = st.text_input("Search the topic you want")
27
 
28
- # Ollama LLama2 LLM with remote or local settings
29
- # Ensure the model points to a valid URL if not running locally
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