Spaces:
Paused
Paused
Tao Wu
commited on
Commit
·
72ac963
1
Parent(s):
06e7b29
fix bugs
Browse files- app/app.py +1 -1
- app/embedding_setup.py +1 -0
app/app.py
CHANGED
@@ -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 courses: name: {doc_name}, learning objectives: {doc_skill}"
|
49 |
prompt = generate_prompt_exp(input_text)
|
50 |
batch_prompts.append(prompt)
|
51 |
|
|
|
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 courses: name: {doc_name}, learning objectives: {doc_skill[:2000]}"
|
49 |
prompt = generate_prompt_exp(input_text)
|
50 |
batch_prompts.append(prompt)
|
51 |
|
app/embedding_setup.py
CHANGED
@@ -185,6 +185,7 @@ def generate_exp(
|
|
185 |
**kwargs,
|
186 |
)
|
187 |
with torch.no_grad():
|
|
|
188 |
generation_output = exp_adapter.generate(
|
189 |
**inputs,
|
190 |
generation_config=generation_config,
|
|
|
185 |
**kwargs,
|
186 |
)
|
187 |
with torch.no_grad():
|
188 |
+
exp_adapter.to(device)
|
189 |
generation_output = exp_adapter.generate(
|
190 |
**inputs,
|
191 |
generation_config=generation_config,
|