Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -18,6 +18,11 @@ from langchain.chat_models import ChatOpenAI
|
|
18 |
# set this key as an environment variable
|
19 |
os.environ["HUGGINGFACEHUB_API_TOKEN"] = st.secrets['Key2']
|
20 |
os.environ["OPENAI_API_KEY"] =st.secrets['Key3']
|
|
|
|
|
|
|
|
|
|
|
21 |
###########################################################################################
|
22 |
|
23 |
def get_pdf_text(pdf_docs : list) -> str:
|
|
|
18 |
# set this key as an environment variable
|
19 |
os.environ["HUGGINGFACEHUB_API_TOKEN"] = st.secrets['Key2']
|
20 |
os.environ["OPENAI_API_KEY"] =st.secrets['Key3']
|
21 |
+
from langchain.llms import LlamaCpp
|
22 |
+
from langchain import PromptTemplate, LLMChain
|
23 |
+
from langchain.callbacks.manager import CallbackManager
|
24 |
+
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
|
25 |
+
|
26 |
###########################################################################################
|
27 |
|
28 |
def get_pdf_text(pdf_docs : list) -> str:
|