Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -137,25 +137,16 @@ else:
|
|
137 |
status_text.markdown("**📝 Generating report with Gemma...**")
|
138 |
|
139 |
# Build the user content with query, sentiment results, and original review data.
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
#"role": "system",
|
151 |
-
#"content": [{"type": "text", "text": "You are a helpful assistant."}]
|
152 |
-
#},
|
153 |
-
{
|
154 |
-
"role": "user",
|
155 |
-
"content": [{"type": "text", "text": user_content_text}]
|
156 |
-
},
|
157 |
-
],
|
158 |
-
]
|
159 |
|
160 |
output = gemma_pipe(messages, max_new_tokens=50)
|
161 |
progress_bar.progress(100)
|
|
|
137 |
status_text.markdown("**📝 Generating report with Gemma...**")
|
138 |
|
139 |
# Build the user content with query, sentiment results, and original review data.
|
140 |
+
# Format the prompt as chat for Gemma
|
141 |
+
messages = [
|
142 |
+
{"role": "user", "content": f"""
|
143 |
+
Generate a concise 300-word report based on the following analysis without repeating what's in the analysis.
|
144 |
+
Query:
|
145 |
+
"{query_input}"
|
146 |
+
Candidate Reviews with their scores:
|
147 |
+
{scored_docs}
|
148 |
+
"""}
|
149 |
+
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
|
151 |
output = gemma_pipe(messages, max_new_tokens=50)
|
152 |
progress_bar.progress(100)
|