Syed Junaid Iqbal commited on
Commit
54be36f
1 Parent(s): 9db002b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -9
app.py CHANGED
@@ -1,14 +1,7 @@
1
  import subprocess
2
 
3
- # Define the command
4
- command = 'CMAKE_ARGS="-DLLAMA_CUBLAS=on" FORCE_CMAKE=1 pip install llama-cpp-python --no-cache-dir'
5
-
6
- # Run the command using subprocess
7
- try:
8
- subprocess.run(command, shell=True, check=True)
9
- print("Command executed successfully.")
10
- except subprocess.CalledProcessError as e:
11
- print(f"Error: {e}")
12
 
13
  import streamlit as st
14
  from langchain.llms import LlamaCpp
@@ -80,6 +73,17 @@ def init_retriever():
80
 
81
  # Check if retriever is already initialized in the session state
82
  if "retriever" not in st.session_state:
 
 
 
 
 
 
 
 
 
 
 
83
  st.session_state.retriever = init_retriever()
84
 
85
  # Function to apply rounded edges using CSS
 
1
  import subprocess
2
 
3
+ import os
4
+ os.environ["TOKENIZERS_PARALLELISM"] = "false"
 
 
 
 
 
 
 
5
 
6
  import streamlit as st
7
  from langchain.llms import LlamaCpp
 
73
 
74
  # Check if retriever is already initialized in the session state
75
  if "retriever" not in st.session_state:
76
+
77
+ # Define the command
78
+ command = 'CMAKE_ARGS="-DLLAMA_CUBLAS=on" FORCE_CMAKE=1 pip install llama-cpp-python --no-cache-dir'
79
+
80
+ # Run the command using subprocess
81
+ try:
82
+ subprocess.run(command, shell=True, check=True)
83
+ print("Command executed successfully.")
84
+ except subprocess.CalledProcessError as e:
85
+ print(f"Error: {e}")
86
+
87
  st.session_state.retriever = init_retriever()
88
 
89
  # Function to apply rounded edges using CSS