tunght commited on
Commit
ec3e0f1
·
1 Parent(s): b8505ee

Add auto structure improvement

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -598,6 +598,8 @@ def generate(*data):
598
  elif len(structure.strip()) > 0:
599
  print('------------')
600
  print("Using structure")
 
 
601
  messages = [
602
  SystemMessage(content=f"""You are a helpful assistant that writes about products for ecommerce websites. Make sure to write in {languages[i]} language."""),
603
  HumanMessage(content=struct_prompt.format(nversions=nversions, min_length=min_length, max_length=max_length, key_features=key_features, structure=structure, copy=copy, included_phrases=included_phrases, excluded_phrases=excluded_phrases)),]
 
598
  elif len(structure.strip()) > 0:
599
  print('------------')
600
  print("Using structure")
601
+ print("Improving structure")
602
+ structure = improve_structure(chat=chat, structure=structure)
603
  messages = [
604
  SystemMessage(content=f"""You are a helpful assistant that writes about products for ecommerce websites. Make sure to write in {languages[i]} language."""),
605
  HumanMessage(content=struct_prompt.format(nversions=nversions, min_length=min_length, max_length=max_length, key_features=key_features, structure=structure, copy=copy, included_phrases=included_phrases, excluded_phrases=excluded_phrases)),]