Spaces:
Paused
Paused
Tao Wu
commited on
Commit
·
d143b74
1
Parent(s):
dc9b128
update exp prompt
Browse files- app/app.py +3 -3
- app/config.py +1 -1
- app/embedding_setup.py +2 -2
app/app.py
CHANGED
@@ -32,8 +32,8 @@ def retrieve_documents(occupation,skills):
|
|
32 |
target_occupation_name, target_occupation_dsp, target_occupation_query = build_occupation_query(target_occupation)
|
33 |
for german_label in skills:
|
34 |
skill_query += german_label + ' '
|
35 |
-
query = 'target occupation: ' + target_occupation_query + '
|
36 |
-
llama_query = 'info:' + target_occupation_name + ' ' + '
|
37 |
print(query)
|
38 |
docs = retriever.get_relevant_documents(query)
|
39 |
|
@@ -45,7 +45,7 @@ def retrieve_documents(occupation,skills):
|
|
45 |
for doc in sorted_docs[:5]:
|
46 |
doc_name = doc.metadata.get('name', 'Unnamed Document')
|
47 |
doc_skill = doc.metadata.get('skills', '')
|
48 |
-
input_text = f"target occupation: {llama_query}\n
|
49 |
prompt = generate_prompt_exp(input_text)
|
50 |
batch_prompts.append(prompt)
|
51 |
|
|
|
32 |
target_occupation_name, target_occupation_dsp, target_occupation_query = build_occupation_query(target_occupation)
|
33 |
for german_label in skills:
|
34 |
skill_query += german_label + ' '
|
35 |
+
query = 'target occupation: ' + target_occupation_query + ' Skills gap:' + skill_query
|
36 |
+
llama_query = 'info:' + target_occupation_name + ' ' + 'Skills gap:' + skill_query
|
37 |
print(query)
|
38 |
docs = retriever.get_relevant_documents(query)
|
39 |
|
|
|
45 |
for doc in sorted_docs[:5]:
|
46 |
doc_name = doc.metadata.get('name', 'Unnamed Document')
|
47 |
doc_skill = doc.metadata.get('skills', '')
|
48 |
+
input_text = f"target occupation: {llama_query}\n Recommended course: name: {doc_name}, learning objectives: {doc_skill[:2000]}"
|
49 |
prompt = generate_prompt_exp(input_text)
|
50 |
batch_prompts.append(prompt)
|
51 |
|
app/config.py
CHANGED
@@ -22,5 +22,5 @@ PERSIST_DIRECTORY = os.getenv('PERSIST_DIRECTORY', "/app/data/EduGBERT_cos_escoa
|
|
22 |
CSV_FILE_PATH = os.getenv('CSV_FILE_PATH', '/app/data/occupations_de.csv')
|
23 |
|
24 |
REC_LORA_MODEL = os.getenv('REC_LORA_MODEL', 'wt3639/Llama-3-8B-Instruct_CourseRec_lora')
|
25 |
-
EXP_LORA_MODEL = os.getenv('EXP_LORA_MODEL', 'wt3639/
|
26 |
LLM_MODEL = os.getenv('LLM_MODEL', 'meta-llama/Meta-Llama-3-8B-Instruct')
|
|
|
22 |
CSV_FILE_PATH = os.getenv('CSV_FILE_PATH', '/app/data/occupations_de.csv')
|
23 |
|
24 |
REC_LORA_MODEL = os.getenv('REC_LORA_MODEL', 'wt3639/Llama-3-8B-Instruct_CourseRec_lora')
|
25 |
+
EXP_LORA_MODEL = os.getenv('EXP_LORA_MODEL', 'wt3639/Lllama-3-8B-instruct-exp-adapter')
|
26 |
LLM_MODEL = os.getenv('LLM_MODEL', 'meta-llama/Meta-Llama-3-8B-Instruct')
|
app/embedding_setup.py
CHANGED
@@ -127,8 +127,8 @@ def evaluate(
|
|
127 |
def compare_docs_with_context(doc_a, doc_b, target_occupation_name, target_occupation_dsp,skill_gap):
|
128 |
|
129 |
#courses = f"First: name: {doc_a.metadata['name']} description:{doc_a.metadata['description']} Second: name: {doc_b.metadata['name']} description:{Sdoc_b.metadata['description']}"
|
130 |
-
courses = f"First: name: {doc_a.metadata['name']} learning outcomes:{doc_a.metadata['skills'][:
|
131 |
-
target_occupation = f"name: {target_occupation_name} description: {target_occupation_dsp[:
|
132 |
skill_gap = skill_gap
|
133 |
prompt = generate_prompt(target_occupation, skill_gap, courses)
|
134 |
prompt = [prompt]
|
|
|
127 |
def compare_docs_with_context(doc_a, doc_b, target_occupation_name, target_occupation_dsp,skill_gap):
|
128 |
|
129 |
#courses = f"First: name: {doc_a.metadata['name']} description:{doc_a.metadata['description']} Second: name: {doc_b.metadata['name']} description:{Sdoc_b.metadata['description']}"
|
130 |
+
courses = f"First: name: {doc_a.metadata['name']} learning outcomes:{doc_a.metadata['skills'][:1500]} Second: name: {doc_b.metadata['name']} learning outcomes:{doc_b.metadata['skills'][:1500]}"
|
131 |
+
target_occupation = f"name: {target_occupation_name} description: {target_occupation_dsp[:1500]}"
|
132 |
skill_gap = skill_gap
|
133 |
prompt = generate_prompt(target_occupation, skill_gap, courses)
|
134 |
prompt = [prompt]
|