frankai98 commited on
Commit
52b9eb2
·
verified ·
1 Parent(s): 91f4509

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -19
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
- user_content_text = (
141
- "Generate a summary report based on this query and data:\n"
142
- f"Query: {query_input}\n"
143
- f"Sentiment Analysis Results: {scored_docs}\n"
144
- f"Original Reviews: {candidate_docs}"
145
- )
146
-
147
- messages = [
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)