Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import streamlit as st
|
|
|
2 |
from dotenv import load_dotenv
|
3 |
from PyPDF2 import PdfReader
|
4 |
from langchain.text_splitter import CharacterTextSplitter
|
@@ -70,11 +71,11 @@ def get_conversation_chain(vectorstore,selected_llm):
|
|
70 |
elif selected_llm == 'Llama2':
|
71 |
print('Llama2 LLM')
|
72 |
model_id = 'meta-llama/Llama-2-7b-chat-hf'
|
73 |
-
hf_auth =
|
74 |
|
75 |
model_config = transformers.AutoConfig.from_pretrained(
|
76 |
model_id,
|
77 |
-
token=
|
78 |
)
|
79 |
|
80 |
device = f'cuda:{cuda.current_device()}' if cuda.is_available() else 'cpu'
|
|
|
1 |
import streamlit as st
|
2 |
+
import os
|
3 |
from dotenv import load_dotenv
|
4 |
from PyPDF2 import PdfReader
|
5 |
from langchain.text_splitter import CharacterTextSplitter
|
|
|
71 |
elif selected_llm == 'Llama2':
|
72 |
print('Llama2 LLM')
|
73 |
model_id = 'meta-llama/Llama-2-7b-chat-hf'
|
74 |
+
hf_auth = os.environ.get("HUGGINGFACEHUB_API_TOKEN")
|
75 |
|
76 |
model_config = transformers.AutoConfig.from_pretrained(
|
77 |
model_id,
|
78 |
+
token=os.environ.get("HUGGINGFACEHUB_API_TOKEN")
|
79 |
)
|
80 |
|
81 |
device = f'cuda:{cuda.current_device()}' if cuda.is_available() else 'cpu'
|