Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
with open("cv.txt", "r") as f:
|
4 |
+
resume_text = f.read()
|
5 |
+
|
6 |
+
def answer_question(question):
|
7 |
+
# Simple logic: search for keyword in CV
|
8 |
+
lower_q = question.lower()
|
9 |
+
for line in resume_text.split("\n"):
|
10 |
+
if any(word in line.lower() for word in lower_q.split()):
|
11 |
+
return f"π From my CV: {line}"
|
12 |
+
return "π Sorry, I couldn't find a match in my resume."
|
13 |
+
|
14 |
+
iface = gr.Interface(fn=answer_question,
|
15 |
+
inputs="text",
|
16 |
+
outputs="text",
|
17 |
+
title="Chat with My Resume π€",
|
18 |
+
description="Ask me about my experience, skills, or education.")
|
19 |
+
|
20 |
+
iface.launch()
|