Talha812 commited on
Commit
e0c3ede
·
verified ·
1 Parent(s): 76b8ab5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -10,11 +10,9 @@ from langchain_community.embeddings import HuggingFaceEmbeddings
10
  from langchain_community.vectorstores import FAISS
11
 
12
  # --- 1. SETUP & API KEYS ---
13
- # Hugging Face uses os.getenv to read secrets
14
  GROQ_API_KEY = os.getenv("GROQ_API_KEY")
15
  client = Groq(api_key=GROQ_API_KEY)
16
 
17
- # Add your links here
18
  GDRIVE_LINKS = [
19
  "https://drive.google.com/file/d/12bS7b-Q3qdbnwCRcTynXjMj1IyKFzBJl/view?usp=sharing"
20
  ]
@@ -79,16 +77,18 @@ footer {visibility: hidden}
79
  #chatbot-container { border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
80
  """
81
 
82
- with gr.Blocks(theme=gr.themes.Soft(primary_hue="indigo"), css=custom_css) as demo:
83
- gr.Markdown("# 📑 Enterprise Knowledge Chat")
 
84
  gr.Markdown("Ask questions based on your specialized document library.")
85
 
 
86
  chatbot = gr.ChatInterface(
87
  fn=respond,
88
  chatbot=gr.Chatbot(height=550, elem_id="chatbot-container"),
89
- textbox=gr.Textbox(placeholder="Ask me anything...", container=False, scale=7),
90
- type="messages"
91
  )
92
 
93
  if __name__ == "__main__":
94
- demo.launch()
 
 
10
  from langchain_community.vectorstores import FAISS
11
 
12
  # --- 1. SETUP & API KEYS ---
 
13
  GROQ_API_KEY = os.getenv("GROQ_API_KEY")
14
  client = Groq(api_key=GROQ_API_KEY)
15
 
 
16
  GDRIVE_LINKS = [
17
  "https://drive.google.com/file/d/12bS7b-Q3qdbnwCRcTynXjMj1IyKFzBJl/view?usp=sharing"
18
  ]
 
77
  #chatbot-container { border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
78
  """
79
 
80
+ # Theme and CSS move to launch() or can be defined here if using newer syntax
81
+ with gr.Blocks() as demo:
82
+ gr.Markdown("# 📑 Intellect-Doc AI")
83
  gr.Markdown("Ask questions based on your specialized document library.")
84
 
85
+ # Removed type="messages" as it's now default
86
  chatbot = gr.ChatInterface(
87
  fn=respond,
88
  chatbot=gr.Chatbot(height=550, elem_id="chatbot-container"),
89
+ textbox=gr.Textbox(placeholder="Ask me anything...", container=False, scale=7)
 
90
  )
91
 
92
  if __name__ == "__main__":
93
+ # Theme and CSS applied here to fix the UserWarning
94
+ demo.launch(theme=gr.themes.Soft(primary_hue="indigo"), css=custom_css)