helamri commited on
Commit
02b2547
Β·
verified Β·
1 Parent(s): 46cf1a8

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -0
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()