NaimaAqeel commited on
Commit
431b4b0
·
verified ·
1 Parent(s): 1cace6b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -4,8 +4,8 @@ from sentence_transformers import SentenceTransformer
4
  import faiss
5
  import numpy as np
6
  import pickle
7
- from langchain_huggingface.llms import HuggingFaceEndpoint
8
- from langchain_huggingface.embeddings import HuggingFaceEmbeddings
9
  import gradio as gr
10
 
11
  # Initialize the embedding model
@@ -14,7 +14,7 @@ embedding_model = SentenceTransformer('all-MiniLM-L6-v2')
14
  # Initialize the HuggingFace LLM
15
  llm = HuggingFaceEndpoint(
16
  endpoint_url="https://api-inference.huggingface.co/models/gpt2",
17
- model_kwargs={"api_key": os.getenv('HUGGINGFACEHUB_API_TOKEN')}
18
  )
19
 
20
  # Initialize the HuggingFace embeddings
@@ -142,3 +142,4 @@ if __name__ == "__main__":
142
 
143
 
144
 
 
 
4
  import faiss
5
  import numpy as np
6
  import pickle
7
+ from langchain.llms import HuggingFaceEndpoint
8
+ from langchain.embeddings import HuggingFaceEmbeddings
9
  import gradio as gr
10
 
11
  # Initialize the embedding model
 
14
  # Initialize the HuggingFace LLM
15
  llm = HuggingFaceEndpoint(
16
  endpoint_url="https://api-inference.huggingface.co/models/gpt2",
17
+ api_key=os.getenv('HUGGINGFACEHUB_API_TOKEN')
18
  )
19
 
20
  # Initialize the HuggingFace embeddings
 
142
 
143
 
144
 
145
+