Spaces:
Running
Running
JaphetHernandez
commited on
Commit
•
70ed6f0
1
Parent(s):
a77f2b3
Update app.py
Browse files
app.py
CHANGED
@@ -15,8 +15,31 @@ tokenizer = AutoTokenizer.from_pretrained(model_name)
|
|
15 |
# Asignar el eos_token como pad_token
|
16 |
tokenizer.pad_token = tokenizer.eos_token
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
# Texto de entrada para la generación
|
19 |
-
input_text =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
inputs = tokenizer(input_text, return_tensors="pt", padding=True)
|
21 |
|
22 |
# Establecer el id del token de padding
|
|
|
15 |
# Asignar el eos_token como pad_token
|
16 |
tokenizer.pad_token = tokenizer.eos_token
|
17 |
|
18 |
+
# Upload CSV file
|
19 |
+
uploaded_file = st.file_uploader("Upload a CSV file", type=["csv"])
|
20 |
+
#print("Query: ", query)
|
21 |
+
|
22 |
+
df = pd.DataFrame(uploaded_file)
|
23 |
+
job_titles = df['job_title'].tolist()
|
24 |
+
query="aspiring human resources specialist"
|
25 |
+
|
26 |
# Texto de entrada para la generación
|
27 |
+
input_text = (
|
28 |
+
f"You are an AI assistant. You have a list of job titles and a search query.\n"
|
29 |
+
f"Your task is to rank these job titles by their semantic similarity to the given query. "
|
30 |
+
f"Please provide the ranking from most relevant to least relevant. "
|
31 |
+
f"Do not calculate cosine similarity; instead, focus on understanding the semantic relevance of each job title to the query.\n"
|
32 |
+
f"\n"
|
33 |
+
f"Format your response like this:\n"
|
34 |
+
f"1. [Most Relevant Job Title]\n"
|
35 |
+
f"2. [Second Most Relevant Job Title]\n"
|
36 |
+
f"...\n"
|
37 |
+
f"N. [Least Relevant Job Title]\n"
|
38 |
+
f"\n"
|
39 |
+
f"Query: \"{query}\"\n"
|
40 |
+
f"Job Titles: {job_titles}\n"
|
41 |
+
)
|
42 |
+
|
43 |
inputs = tokenizer(input_text, return_tensors="pt", padding=True)
|
44 |
|
45 |
# Establecer el id del token de padding
|