Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -28,10 +28,11 @@ if tokenizer.pad_token is None:
|
|
28 |
tokenizer.pad_token_id = tokenizer.convert_tokens_to_ids(tokenizer.pad_token)
|
29 |
model.config.pad_token_id = tokenizer.pad_token_id
|
30 |
|
31 |
-
# Refined Prompt
|
32 |
PROMPT_TEMPLATE = """You are an AI assistant for construction supervisors. Given the role, project, milestones, and a reflection log, generate:
|
33 |
|
34 |
-
1. A Daily Checklist with
|
|
|
35 |
2. Focus Suggestions based on concerns or keywords in the reflection log. Provide at least 2 suggestions.
|
36 |
|
37 |
Inputs:
|
@@ -41,9 +42,14 @@ Milestones: {milestones}
|
|
41 |
Reflection Log: {reflection}
|
42 |
|
43 |
Output Format:
|
44 |
-
Checklist:
|
45 |
-
-
|
46 |
-
|
|
|
|
|
|
|
|
|
|
|
47 |
Suggestions:
|
48 |
-
|
49 |
"""
|
@@ -190,7 +196,7 @@ def generate_outputs(role, supervisor_name, project_id, milestones, reflection):
|
|
190 |
with torch.no_grad():
|
191 |
outputs = model.generate(
|
192 |
inputs['input_ids'],
|
193 |
-
max_new_tokens=
|
194 |
no_repeat_ngram_size=2,
|
195 |
do_sample=True,
|
196 |
top_p=0.9,
|
@@ -269,4 +275,3 @@ def create_interface():
|
|
269 |
if __name__ == "__main__":
|
270 |
app = create_interface()
|
271 |
app.launch()
|
272 |
-
|
|
|
28 |
tokenizer.pad_token_id = tokenizer.convert_tokens_to_ids(tokenizer.pad_token)
|
29 |
model.config.pad_token_id = tokenizer.pad_token_id
|
30 |
|
31 |
+
# Refined Prompt to generate day-by-day tasks based on milestones
|
32 |
PROMPT_TEMPLATE = """You are an AI assistant for construction supervisors. Given the role, project, milestones, and a reflection log, generate:
|
33 |
|
34 |
+
1. A Daily Checklist with clear and concise tasks based on the role and milestones.
|
35 |
+
Split the checklist into day-by-day tasks for a specified time period (e.g., one week).
|
36 |
2. Focus Suggestions based on concerns or keywords in the reflection log. Provide at least 2 suggestions.
|
37 |
|
38 |
Inputs:
|
|
|
42 |
Reflection Log: {reflection}
|
43 |
|
44 |
Output Format:
|
45 |
+
Checklist (Day-by-Day):
|
46 |
+
- Day 1:
|
47 |
+
- Task 1
|
48 |
+
- Task 2
|
49 |
+
- Day 2:
|
50 |
+
- Task 1
|
51 |
+
- Task 2
|
52 |
+
...
|
53 |
Suggestions:
|
54 |
-
|
55 |
"""
|
|
|
196 |
with torch.no_grad():
|
197 |
outputs = model.generate(
|
198 |
inputs['input_ids'],
|
199 |
+
max_new_tokens=150, # Increased max tokens to capture more content
|
200 |
no_repeat_ngram_size=2,
|
201 |
do_sample=True,
|
202 |
top_p=0.9,
|
|
|
275 |
if __name__ == "__main__":
|
276 |
app = create_interface()
|
277 |
app.launch()
|
|