MBilal-72 commited on
Commit
2ae095c
·
verified ·
1 Parent(s): ea7b8ea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -12,8 +12,8 @@ from langchain.schema import Document
12
  from langchain_groq import ChatGroq
13
 
14
  # --- Environment Variables ---
15
- GROQ_API_KEY = os.getenv("GROQ_API_KEY", "your-groq-api-key")
16
- HUGGINGFACE_API_KEY = os.getenv("HUGGINGFACE_API_KEY", "your-huggingface-api-key")
17
 
18
  # --- Initialize Groq LLM ---
19
  # llm = GroqLLM(
@@ -28,14 +28,14 @@ llm = ChatGroq(
28
  )
29
 
30
  # --- HuggingFace Embeddings ---
31
- # embedding = HuggingFaceEmbeddings(
32
- # model_name="sentence-transformers/all-MiniLM-L6-v2",
33
- # cache_folder="./hf_cache",
34
- # huggingfacehub_api_token=HUGGINGFACE_API_KEY
35
- # )
36
  embedding = HuggingFaceEmbeddings(
37
- model_name="sentence-transformers/all-MiniLM-L6-v2"
 
 
38
  )
 
 
 
39
 
40
  # --- Streamlit UI ---
41
  st.title("📄📥 Chat with PDF or Text using Groq + RAG")
 
12
  from langchain_groq import ChatGroq
13
 
14
  # --- Environment Variables ---
15
+ # GROQ_API_KEY = os.getenv("GROQ_API_KEY", "your-groq-api-key")
16
+ # HUGGINGFACE_API_KEY = os.getenv("HUGGINGFACE_API_KEY", "your-huggingface-api-key")
17
 
18
  # --- Initialize Groq LLM ---
19
  # llm = GroqLLM(
 
28
  )
29
 
30
  # --- HuggingFace Embeddings ---
 
 
 
 
 
31
  embedding = HuggingFaceEmbeddings(
32
+ model_name="sentence-transformers/all-MiniLM-L6-v2",
33
+ cache_folder="./hf_cache",
34
+ huggingfacehub_api_token=HUGGINGFACE_API_KEY
35
  )
36
+ # embedding = HuggingFaceEmbeddings(
37
+ # model_name="sentence-transformers/all-MiniLM-L6-v2"
38
+ # )
39
 
40
  # --- Streamlit UI ---
41
  st.title("📄📥 Chat with PDF or Text using Groq + RAG")