Skip to content

Commit

Permalink
v0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jiatastic committed Jul 15, 2023
1 parent ae24956 commit 7f29caa
Show file tree
Hide file tree
Showing 23 changed files with 481 additions and 234 deletions.
2 changes: 1 addition & 1 deletion .streamlit/config.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[theme]
base = 'light'
primaryColor = 'F63366'
font = 'sans serif'
font = 'sans serif'
115 changes: 60 additions & 55 deletions Homepage.py
Original file line number Diff line number Diff line change
@@ -1,84 +1,89 @@
import streamlit as st
import json
from streamlit_lottie import st_lottie
from streamlit_option_menu import option_menu
from PIL import Image
from app_utils import switch_page
from initialization import initialize_session_state, embedding, resume_reader
from prompts.prompts import templates
from typing import Literal
from dataclasses import dataclass
st.set_page_config(page_title = "👩‍💻 AI Interviewer", layout = "centered")

st.spinner(text="loading...")

def load_lottiefile(filepath: str):
with open(filepath, "r") as f:
return json.load(f)

im = Image.open("static/images/chat.png")
st.set_page_config(page_title = "GPTInterviewer", page_icon = im, layout = "wide")
home_title = "👩‍💻 AI Interviewer"
home_introduction = "Welcome to AI Interviewer, empowering your interview preparation with generative AI."

with st.sidebar:

st.markdown('### GPTInterviewer - V0.1.1')
st.markdown('### 👩‍💻AI Interviewer - V0.1.2')
st.markdown("""
#### Let's contact:
[Haoxiang Jia](https://www.linkedin.com/in/haoxiang-jia/)
[Zicheng Wang](https://www.linkedin.com/in/todd-wang-5001aa264/)
#### Please fill the form, we'd love to have your feedback:
[Feedback Form](https://docs.google.com/forms/d/13f4q03bk4lD7sKR7qZ8UM1lQDo6NhRaAKv7uIeXHEaQ/edit)
#### What's next?
v0.1.2:
1. A more robust llm-powered evaluation system.
We're trying to build a system that are close to human evaluation in real world.
#### What's next?
#### Powered by
[OpenAI](https://openai.com/)
[FAISS](https://github.com/facebookresearch/faiss)
[Langchain](https://github.com/hwchase17/langchain)
""")
st.markdown("<hr>", unsafe_allow_html=True)
""")

st.markdown("<h1 style='text-align: center;'>Your Career Workshop Anytime from Anywhere</h1>", unsafe_allow_html=True)
st.markdown("<p style='text-align: center; color: grey;'> GPT Interviewer is a generative AI powered tool that provides you with realistic interview experience</p>", unsafe_allow_html=True)
st.markdown("<p style='text-align: center; color: grey;'> You're no longer practice with a static list of questions.</p>", unsafe_allow_html=True)
st.markdown(
"<style>#MainMenu{visibility:hidden;}</style>",
unsafe_allow_html=True
)

col1, col2, col3 = st.columns(3)
with col1:
st.write(' ')
with col2:
st_lottie(load_lottiefile("images/talk.json"), speed=1, reverse=False, loop=True, quality="high")
with col3:
st.write(' ')
st.markdown(f"""# {home_title} <span style=color:#2E9BF5><font size=5>Beta</font></span>""",unsafe_allow_html=True)
st.markdown("""\n""")
#st.markdown("#### Greetings")
st.markdown("Welcome to AI Interviewer! 👏AI Interviewer is a generative AI powered tool that provides you with realistic interview experience. "
"You can upload your resume and enter job descriptions, AI Interviewer will ask you customized questions. In addition, you can configure your own AI Interviewer!")
st.markdown("#### Get started!")
st.markdown("Select one of the following screens to start your interview!")

selected = option_menu(
menu_title= None,
options=["Resume Screen", "Technical Screen", "Behavioral Screen"],
options=["Professional", "Resume", "Behavioral","Customize!"],
icons = ["cloud-upload", "cast", "cast"],
default_index=0,
orientation="horizontal",
)

st.markdown("#")
st.markdown("<hr>", unsafe_allow_html=True)

st.markdown("<h1 style='text-align: center;'>Features</h1>", unsafe_allow_html=True)
st.markdown("#")
col1, col2, col3 = st.columns(3)
with col1:
st_lottie(load_lottiefile("images/brain.json"), speed=1, reverse=False, loop=True, quality="high", height=300)
st.markdown("<h3 style='text-align: center;'>Personalization</h3>", unsafe_allow_html=True)
with col2:
st_lottie(load_lottiefile("images/recording.json"), speed=1, reverse=False, loop=True, quality="high", height=300)
st.markdown("<h3 style='text-align: center;'>Voice Interaction</h3>", unsafe_allow_html=True)
with col3:
st_lottie(load_lottiefile("images/evaluation.json"), speed=1, reverse=False, loop=True, quality="high", height=300)
st.markdown("<h3 style='text-align: center;'>Feedback</h3>", unsafe_allow_html=True)
if selected == 'Professional':
st.info("""
📚In this session, the AI Interviewer will assess your technical skills as they relate to the job description.
- Press the microphone to start answering.
- Each Interview will take 10 to 15 mins.
- Start introduce yourself and enjoy! """)
if st.button("Start Interview Session!"):
switch_page("Session - Professional")

if selected == 'Resume':
st.info("""
📚In this session, the AI Interviewer will review your resume and discuss your past experiences.
- Press the microphone to start answering.
- Each Interview will take 10 to 15 mins.
- Start introduce yourself and enjoy! """
)
if st.button("Start Interview Session!"):
switch_page("Session - Resume")

st.markdown("<hr>", unsafe_allow_html=True)
st.markdown("<p style='text-align: center; color: grey;'> Fordham University Center of Digital Transformation DesignLAB </p>", unsafe_allow_html=True)
if selected == 'Behavioral':
st.info("""
📚In this session, the AI Interviewer will assess your soft skills as they relate to the job description.
- Press the microphone to start answering.
- Each Interview will take 10 to 15 mins.
- Start introduce yourself and enjoy!
Coming this week!""")
if selected == 'Customize!':
st.info("""
📚In this session, you can customize your own AI Interviewer and practice with it!
- Configure AI Interviewer in different specialties.
- Configure AI Interviewer in different personalities.
- Different tones of voice.
Coming at the end of July""")
Binary file added __pycache__/app_utils.cpython-310.pyc
Binary file not shown.
Binary file added __pycache__/initialization.cpython-310.pyc
Binary file not shown.
23 changes: 23 additions & 0 deletions app_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
def switch_page(page_name: str):
from streamlit.runtime.scriptrunner import RerunData, RerunException
from streamlit.source_util import get_pages

def standardize_name(name: str) -> str:
return name.lower().replace("_", " ")

page_name = standardize_name(page_name)

pages = get_pages("home.py") # OR whatever your main page is called

for page_hash, config in pages.items():
if standardize_name(config["page_name"]) == page_name:
raise RerunException(
RerunData(
page_script_hash=page_hash,
page_name=page_name,
)
)

page_names = [standardize_name(config["page_name"]) for config in pages.values()]

raise ValueError(f"Could not find page {page_name}. Must be one of {page_names}")
File renamed without changes.
84 changes: 84 additions & 0 deletions archived/Homepage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
import streamlit as st
import json
from streamlit_lottie import st_lottie
from streamlit_option_menu import option_menu
from PIL import Image

st.spinner(text="loading...")

def load_lottiefile(filepath: str):
with open(filepath, "r") as f:
return json.load(f)

im = Image.open("../static/images/chat.png")
st.set_page_config(page_title = "GPTInterviewer", page_icon = im, layout = "wide")

with st.sidebar:

st.markdown('### GPTInterviewer - V0.1.1')
st.markdown("""
#### Let's contact:
[Haoxiang Jia](https://www.linkedin.com/in/haoxiang-jia/)
[Zicheng Wang](https://www.linkedin.com/in/todd-wang-5001aa264/)
#### Please fill the form, we'd love to have your feedback:
[Feedback Form](https://docs.google.com/forms/d/13f4q03bk4lD7sKR7qZ8UM1lQDo6NhRaAKv7uIeXHEaQ/edit)
#### What's next?
v0.1.2:
1. A more robust llm-powered evaluation system.
We're trying to build a system that are close to human evaluation in real world.
#### Powered by
[OpenAI](https://openai.com/)
[FAISS](https://github.com/facebookresearch/faiss)
[Langchain](https://github.com/hwchase17/langchain)
""")

st.markdown("<hr>", unsafe_allow_html=True)

st.markdown("<h1 style='text-align: center;'>Your Career Workshop Anytime from Anywhere</h1>", unsafe_allow_html=True)
st.markdown("<p style='text-align: center; color: grey;'> GPT Interviewer is a generative AI powered tool that provides you with realistic interview experience</p>", unsafe_allow_html=True)
st.markdown("<p style='text-align: center; color: grey;'> You're no longer practice with a static list of questions.</p>", unsafe_allow_html=True)

col1, col2, col3 = st.columns(3)
with col1:
st.write(' ')
with col2:
st_lottie(load_lottiefile("../images/talk.json"), speed=1, reverse=False, loop=True, quality="high")
with col3:
st.write(' ')

selected = option_menu(
menu_title= None,
options=["Resume Screen", "Technical Screen", "Behavioral Screen"],
icons = ["cloud-upload", "cast", "cast"],
default_index=0,
orientation="horizontal",
)

st.markdown("#")
st.markdown("<hr>", unsafe_allow_html=True)

st.markdown("<h1 style='text-align: center;'>Features</h1>", unsafe_allow_html=True)
st.markdown("#")
col1, col2, col3 = st.columns(3)
with col1:
st_lottie(load_lottiefile("../images/brain.json"), speed=1, reverse=False, loop=True, quality="high", height=300)
st.markdown("<h3 style='text-align: center;'>Personalization</h3>", unsafe_allow_html=True)
with col2:
st_lottie(load_lottiefile("../images/recording.json"), speed=1, reverse=False, loop=True, quality="high", height=300)
st.markdown("<h3 style='text-align: center;'>Voice Interaction</h3>", unsafe_allow_html=True)
with col3:
st_lottie(load_lottiefile("../images/evaluation.json"), speed=1, reverse=False, loop=True, quality="high", height=300)
st.markdown("<h3 style='text-align: center;'>Feedback</h3>", unsafe_allow_html=True)


st.markdown("<hr>", unsafe_allow_html=True)
st.markdown("<p style='text-align: center; color: grey;'> Fordham University Center of Digital Transformation DesignLAB </p>", unsafe_allow_html=True)
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,23 @@
nltk.download('punkt')

### ——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
def load_lottiefile(filepath: str):
with open(filepath, "r") as f:
return json.load(f)

st_lottie(load_lottiefile("images/hello.json"), speed=1, reverse=False, loop=True, quality="high", height=300)
home_title = "AI Interviewer"
home_introduction = "Welcome to AI Interviewer, empowering your interview preparation with generative AI. "

st.markdown(
"<style>#MainMenu{visibility:hidden;}</style>",
unsafe_allow_html=True
)

#st.title(home_title)
st.markdown(f"""# {home_title} <span style=color:#2E9BF5><font size=5>Beta</font></span>""",unsafe_allow_html=True)

st.markdown("""\n""")
st.markdown("#### Greetings")
st.write(home_introduction)


st.markdown("### Instruction: ")
st.markdown("""
In this session, the GPT Interviewer will assess your technical skills as they relate to the job description.
Expand Down Expand Up @@ -60,13 +72,12 @@ def load_css():

""" Load CSS """

with open("static/styles.css", "r") as f:
with open("../static/styles.css", "r") as f:
css = f"<style>{f.read()}</style>"
st.markdown(css, unsafe_allow_html=True)

def initialize_session_state():

""" initialize session states """
""" initialize session states ccccc"""

if 'jd_docsearch' not in st.session_state:
st.session_state.jd_docserch = save_vector(jd)
Expand Down Expand Up @@ -138,10 +149,10 @@ def answer_call_back():
# user input
human_answer = st.session_state.answer
# transcribe audio
save_wav_file("temp/audio.wav", human_answer)
save_wav_file("../temp/audio.wav", human_answer)

try:
input = transcribe("temp/audio.wav")
input = transcribe("../temp/audio.wav")
# save human_answer to history
st.session_state.jd_history.append(
Message("human", input)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,9 @@ class Message:
def save_vector(resume):

pdf_reader = PdfReader(resume)

text = ""
for page in pdf_reader.pages:
text += page.extract_text()

# Split the document into chunks
text_splitter = NLTKTextSplitter()
texts = text_splitter.split_text(text)
Expand All @@ -67,7 +65,6 @@ def save_vector(resume):

embeddings = OpenAIEmbeddings()
docsearch = FAISS.from_texts(texts, embeddings)

return docsearch

def load_css():
Expand Down
Empty file added archived/interviews/__init__.py
Empty file.
File renamed without changes.
File renamed without changes.
Binary file removed azure_service/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 7f29caa

Please sign in to comment.