bigghuggs commited on
Commit
241e3f3
·
verified ·
1 Parent(s): c707747

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -1135,6 +1135,7 @@ def changeSummaryFilter(evt: gr.SelectData):
1135
  print('changeSummaryFilter -- in Script: ', lapse, fdsdweesdd)
1136
  start = time.time()
1137
  found_terms_4_room_items = [(product_pd_counts[ir][0], findShoppingRelevantTerms(r)) for ir,r in enumerate(responses)]
 
1138
  #dsdsd = 'ITEM TOPICS: \n\n'+'\n\n'.join(['ITEM : '+data[0].upper() + f'\n\n{data[0].upper()} TOPICS: \n'+'\n\n'.join(['Topic: '+term[1:-1].upper()+'\n...'+text for term,text in data[1].items()]) for idx,data in enumerate(found_terms_4_room_items ) if data[1]])
1139
  start = time.time()
1140
  topics = 'ITEM TOPICS: \n\n'+'\n\n'.join(['\n\n'.join([f'{data[0].upper()} TOPIC: '+term[1:-1].upper()+'\n...'+text for term,text in data[1].items()]) for idx,data in enumerate(found_terms_4_room_items ) if data[1]])
@@ -1158,7 +1159,7 @@ def changeSummaryFilter(evt: gr.SelectData):
1158
  elif idx==len(found_terms_4_room_items)-1:
1159
  prompt += "Keep in mind this is the last of many items we are reviewing, so ensure your writing reflects the fact that this is the final item being reported on and do a review wrap-up/send off for this particular room's decor review. Maybe begin by writing something along the lines of 'Okay lastly we have the...' or 'Well, our final item is...' or what have you jare examples of how you might word things. You don't have to use these examples exactly, just word things similarly. Be creative.."
1160
  else:
1161
- prompt += "Keep in mind this is the one of many items we have already reviewed and one of other yet to be reviewed, so ensure your writing reflects the fact that this is just the next item being reported on. Maybe begin by writing something along the lines of 'Okay now we have...' or 'So next up is...' or what have you are examples of how you might word things. You don't have to use these examples exactly, just word things similarly. Be creative."
1162
 
1163
  response = client.text_generation(prompt, model="mistralai/Mixtral-8x7B-Instruct-v0.1", max_new_tokens=2500)
1164
  response = response.replace("I know what you're thinking", np.random.choice(alarm3)).replace("I know what you are thinking", np.random.choice(alarm3))
 
1135
  print('changeSummaryFilter -- in Script: ', lapse, fdsdweesdd)
1136
  start = time.time()
1137
  found_terms_4_room_items = [(product_pd_counts[ir][0], findShoppingRelevantTerms(r)) for ir,r in enumerate(responses)]
1138
+ del responses
1139
  #dsdsd = 'ITEM TOPICS: \n\n'+'\n\n'.join(['ITEM : '+data[0].upper() + f'\n\n{data[0].upper()} TOPICS: \n'+'\n\n'.join(['Topic: '+term[1:-1].upper()+'\n...'+text for term,text in data[1].items()]) for idx,data in enumerate(found_terms_4_room_items ) if data[1]])
1140
  start = time.time()
1141
  topics = 'ITEM TOPICS: \n\n'+'\n\n'.join(['\n\n'.join([f'{data[0].upper()} TOPIC: '+term[1:-1].upper()+'\n...'+text for term,text in data[1].items()]) for idx,data in enumerate(found_terms_4_room_items ) if data[1]])
 
1159
  elif idx==len(found_terms_4_room_items)-1:
1160
  prompt += "Keep in mind this is the last of many items we are reviewing, so ensure your writing reflects the fact that this is the final item being reported on and do a review wrap-up/send off for this particular room's decor review. Maybe begin by writing something along the lines of 'Okay lastly we have the...' or 'Well, our final item is...' or what have you jare examples of how you might word things. You don't have to use these examples exactly, just word things similarly. Be creative.."
1161
  else:
1162
+ prompt += "Keep in mind this is one of many items we have already reviewed and one of other yet to be reviewed, so ensure your writing reflects the fact that this is just the next item being reported on. Maybe begin by writing something along the lines of 'Okay now we have...' or 'So next up is...' or what have you are examples of how you might word things. You don't have to use these examples exactly, just word things similarly. Be creative."
1163
 
1164
  response = client.text_generation(prompt, model="mistralai/Mixtral-8x7B-Instruct-v0.1", max_new_tokens=2500)
1165
  response = response.replace("I know what you're thinking", np.random.choice(alarm3)).replace("I know what you are thinking", np.random.choice(alarm3))