|
|
import gradio as gr |
|
|
|
|
|
with open("cv.txt", "r") as f: |
|
|
resume_text = f.read() |
|
|
|
|
|
def answer_question(question): |
|
|
|
|
|
lower_q = question.lower() |
|
|
for line in resume_text.split("\n"): |
|
|
if any(word in line.lower() for word in lower_q.split()): |
|
|
return f"π From my CV: {line}" |
|
|
return "π Sorry, I couldn't find a match in my resume." |
|
|
|
|
|
iface = gr.Interface(fn=answer_question, |
|
|
inputs="text", |
|
|
outputs="text", |
|
|
title="Chat with My Resume π€", |
|
|
description="Ask me about my experience, skills, or education.") |
|
|
|
|
|
iface.launch() |
|
|
|