Yannick Lemin commited on
Commit
5f8c908
·
1 Parent(s): 79f6003

forced dark mode

Browse files
Files changed (1) hide show
  1. app.py +15 -2
app.py CHANGED
@@ -87,6 +87,7 @@ class Me:
87
  self.resume += text
88
 
89
  reader = PdfReader("me/yle-linkedin-052025.pdf")
 
90
  self.linkedin = ""
91
  for page in reader.pages:
92
  text = page.extract_text()
@@ -108,7 +109,8 @@ class Me:
108
  return results
109
 
110
  def system_prompt(self):
111
- system_prompt = f"""You are acting as YannBot, the virtual persona of {self.name}. You are answering questions on {self.name}'s website,
 
112
  particularly questions related to {self.name}'s career, background, skills and experience.
113
  Your responsibility is to represent {self.name} for interactions on the website as faithfully as possible.
114
  You are given a summary of {self.name}'s background, resume and LinkedIn profile which you can use to answer questions.
@@ -147,6 +149,17 @@ With this context, please chat with the user, always staying in character as {se
147
  return response.choices[0].message.content
148
 
149
 
 
 
 
 
 
 
 
 
 
 
 
150
  if __name__ == "__main__":
151
  me = Me()
152
- gr.ChatInterface(me.chat, type="messages").launch()
 
87
  self.resume += text
88
 
89
  reader = PdfReader("me/yle-linkedin-052025.pdf")
90
+
91
  self.linkedin = ""
92
  for page in reader.pages:
93
  text = page.extract_text()
 
109
  return results
110
 
111
  def system_prompt(self):
112
+ system_prompt = f"""You are acting as YannBot, the virtual persona of {self.name}. Please refer to yourself as YannBot
113
+ You are answering questions on {self.name}'s website,
114
  particularly questions related to {self.name}'s career, background, skills and experience.
115
  Your responsibility is to represent {self.name} for interactions on the website as faithfully as possible.
116
  You are given a summary of {self.name}'s background, resume and LinkedIn profile which you can use to answer questions.
 
149
  return response.choices[0].message.content
150
 
151
 
152
+ js_func = """
153
+ function refresh() {
154
+ const url = new URL(window.location);
155
+
156
+ if (url.searchParams.get('__theme') !== 'dark') {
157
+ url.searchParams.set('__theme', 'dark');
158
+ window.location.href = url.href;
159
+ }
160
+ }
161
+ """
162
+
163
  if __name__ == "__main__":
164
  me = Me()
165
+ gr.ChatInterface(me.chat, type="messages", js=js_func).launch()