Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,7 @@ from langchain.llms import HuggingFacePipeline
|
|
6 |
from huggingface_hub import login
|
7 |
from pydantic import BaseModel, model_validator
|
8 |
|
|
|
9 |
# Token Secret of Hugging Face
|
10 |
huggingface_token = st.secrets["HUGGINGFACEHUB_API_TOKEN"]
|
11 |
login(huggingface_token)
|
@@ -50,18 +51,19 @@ if uploaded_file is not None:
|
|
50 |
if query:
|
51 |
st.write("Query:", query)
|
52 |
|
53 |
-
# Crear el prompt para el LLM
|
54 |
prompt = f"""
|
55 |
-
You are an AI assistant. You
|
56 |
-
Your task is to
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
|
|
62 |
...
|
|
|
63 |
|
64 |
-
Query: {query}
|
65 |
Job Titles: {job_titles}
|
66 |
"""
|
67 |
|
|
|
6 |
from huggingface_hub import login
|
7 |
from pydantic import BaseModel, model_validator
|
8 |
|
9 |
+
|
10 |
# Token Secret of Hugging Face
|
11 |
huggingface_token = st.secrets["HUGGINGFACEHUB_API_TOKEN"]
|
12 |
login(huggingface_token)
|
|
|
51 |
if query:
|
52 |
st.write("Query:", query)
|
53 |
|
|
|
54 |
prompt = f"""
|
55 |
+
You are an AI assistant. You have a list of job titles and a search query.
|
56 |
+
Your task is to rank these job titles by their semantic similarity to the given query.
|
57 |
+
Please provide the ranking from most relevant to least relevant.
|
58 |
+
Do not calculate cosine similarity; instead, focus on understanding the semantic relevance of each job title to the query.
|
59 |
+
|
60 |
+
Format your response like this:
|
61 |
+
1. [Most Relevant Job Title]
|
62 |
+
2. [Second Most Relevant Job Title]
|
63 |
...
|
64 |
+
N. [Least Relevant Job Title]
|
65 |
|
66 |
+
Query: "{query}"
|
67 |
Job Titles: {job_titles}
|
68 |
"""
|
69 |
|