Harsh4334632 commited on
Commit
7371d1a
·
verified ·
1 Parent(s): 44effb6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -12
app.py CHANGED
@@ -14,7 +14,7 @@ class MyApp:
14
  self.documents = []
15
  self.embeddings = None
16
  self.index = None
17
- self.load_pdf("THEDIA1.pdf")
18
  self.build_vector_db()
19
 
20
  def load_pdf(self, file_path: str) -> None:
@@ -53,7 +53,7 @@ def respond(
53
  temperature: float,
54
  top_p: float,
55
  ):
56
- system_message = "You are a knowledgeable DBT coach. You always talk about one options at at a time. you add greetings and you ask questions like real counsellor. Remember you are helpful and a good listener. You are concise and never ask multiple questions, or give long response. You response like a human counsellor accurately and correctly. consider the users as your client. and practice verbal cues only where needed. Remember you must be respectful and consider that the user may not be in a situation to deal with a wordy chatbot. You Use DBT book to guide users through DBT exercises and provide helpful information. When needed only then you ask one follow up question at a time to guide the user to ask appropiate question. You avoid giving suggestion if any dangerous act is mentioned by the user and refer to call someone or emergency."
57
  messages = [{"role": "system", "content": system_message}]
58
 
59
  for val in history:
@@ -85,22 +85,22 @@ demo = gr.Blocks()
85
 
86
  with demo:
87
  gr.Markdown(
88
- "‼️Disclaimer: This chatbot is based on a DBT exercise book that is publicly available. and just to test RAG implementation.‼️"
89
  )
90
 
91
  chatbot = gr.ChatInterface(
92
  respond,
93
  examples=[
94
- ["I feel overwhelmed with work."],
95
- ["Can you guide me through a quick meditation?"],
96
- ["How do I stop worrying about things I can't control?"],
97
- ["What are some DBT skills for managing anxiety?"],
98
- ["Can you explain mindfulness in DBT?"],
99
- ["I am interested in DBT excercises"],
100
- ["I feel restless. Please help me."],
101
- ["I have destructive thoughts coming to my mind repetatively."]
102
  ],
103
- title='Dialectical Behaviour Therapy Assistant👩‍⚕️🧘‍♀️'
104
  )
105
 
106
  if __name__ == "__main__":
 
14
  self.documents = []
15
  self.embeddings = None
16
  self.index = None
17
+ self.load_pdf("ENGINEERING.pdf")
18
  self.build_vector_db()
19
 
20
  def load_pdf(self, file_path: str) -> None:
 
53
  temperature: float,
54
  top_p: float,
55
  ):
56
+ system_message = "You are a knowledgeable and skilled electrical engineer. You provide clear, concise, and helpful information about electrical systems, circuits, and devices. You answer one question at a time, ensuring that your responses are easy to understand and informative. Remember to be respectful, patient, and thorough, considering that users may have varying levels of technical knowledge. You guide users through troubleshooting electrical issues, offer advice on electrical design and safety, and provide recommendations for common electrical problems. If a user mentions a potentially dangerous electrical situation, you advise them to turn off the power immediately and contact a professional electrician. Your goal is to help users understand and solve their electrical issues while promoting safety and best practices."
57
  messages = [{"role": "system", "content": system_message}]
58
 
59
  for val in history:
 
85
 
86
  with demo:
87
  gr.Markdown(
88
+ "‼️Disclaimer: This chatbot is based on a numerical modelling and design of machines book that is publicly available. and just to test RAG implementation.‼️"
89
  )
90
 
91
  chatbot = gr.ChatInterface(
92
  respond,
93
  examples=[
94
+ ["How do I troubleshoot a circuit breaker that keeps tripping?"],
95
+ ["Can you explain how to design a basic electrical circuit?"],
96
+ ["What safety precautions should I take when working with electrical wiring?"],
97
+ ["How can I calculate the voltage drop in a long electrical cable?"],
98
+ ["Could you recommend energy-saving tips for home appliances?"],
99
+ ["How does surge protection work, and why is it important?"],
100
+ ["What are the current standards for electrical wiring in new construction?"],
101
+ ["What are the key components of a residential electrical panel?"]
102
  ],
103
+ title='Electrical Engineer'
104
  )
105
 
106
  if __name__ == "__main__":