Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- app.py +5 -5
- resume.pdf +3 -0
.gitattributes
CHANGED
|
@@ -34,3 +34,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
CV[[:space:]]Zhao.pdf filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
CV[[:space:]]Zhao.pdf filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
resume.pdf filter=lfs diff=lfs merge=lfs -text
|
app.py
CHANGED
|
@@ -8,23 +8,23 @@ client = OpenAI(api_key="sk-108af85cd4d747dd88e3d445ddcad8cc", base_url="https:/
|
|
| 8 |
|
| 9 |
load_dotenv(override=True)
|
| 10 |
openai = OpenAI()
|
| 11 |
-
reader = PdfReader("
|
| 12 |
-
|
| 13 |
for page in reader.pages:
|
| 14 |
text = page.extract_text()
|
| 15 |
if text:
|
| 16 |
-
|
| 17 |
with open("summary.txt", "r", encoding="utf-8") as f:
|
| 18 |
summary = f.read()
|
| 19 |
name = "Liang Zhao"
|
| 20 |
system_prompt = f"You are acting as {name}. You are answering questions on {name}'s website, \
|
| 21 |
particularly questions related to {name}'s career, background, skills and experience. \
|
| 22 |
Your responsibility is to represent {name} for interactions on the website as faithfully as possible. \
|
| 23 |
-
You are given a summary of {name}'s background and
|
| 24 |
Be professional and engaging, as if talking to a potential client or future employer who came across the website. \
|
| 25 |
If you don't know the answer, say so."
|
| 26 |
|
| 27 |
-
system_prompt += f"\n\n## Summary:\n{summary}\n\n##
|
| 28 |
system_prompt += f"With this context, please chat with the user, always staying in character as {name}."
|
| 29 |
def chat(message, history):
|
| 30 |
messages = [{"role": "system", "content": system_prompt}] + history + [{"role": "user", "content": message}]
|
|
|
|
| 8 |
|
| 9 |
load_dotenv(override=True)
|
| 10 |
openai = OpenAI()
|
| 11 |
+
reader = PdfReader("resume.pdf")
|
| 12 |
+
resume = ""
|
| 13 |
for page in reader.pages:
|
| 14 |
text = page.extract_text()
|
| 15 |
if text:
|
| 16 |
+
resume += text
|
| 17 |
with open("summary.txt", "r", encoding="utf-8") as f:
|
| 18 |
summary = f.read()
|
| 19 |
name = "Liang Zhao"
|
| 20 |
system_prompt = f"You are acting as {name}. You are answering questions on {name}'s website, \
|
| 21 |
particularly questions related to {name}'s career, background, skills and experience. \
|
| 22 |
Your responsibility is to represent {name} for interactions on the website as faithfully as possible. \
|
| 23 |
+
You are given a summary of {name}'s background and Resume which you can use to answer questions. \
|
| 24 |
Be professional and engaging, as if talking to a potential client or future employer who came across the website. \
|
| 25 |
If you don't know the answer, say so."
|
| 26 |
|
| 27 |
+
system_prompt += f"\n\n## Summary:\n{summary}\n\n## Resume:\n{resume}\n\n"
|
| 28 |
system_prompt += f"With this context, please chat with the user, always staying in character as {name}."
|
| 29 |
def chat(message, history):
|
| 30 |
messages = [{"role": "system", "content": system_prompt}] + history + [{"role": "user", "content": message}]
|
resume.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8eaa118e12882c91ab66a29d23d8cfcd32aaa51d2f0036e933284d57fbdaf672
|
| 3 |
+
size 180689
|