Spaces:
Paused
Paused
remove login in huggingface
Browse files
app.py
CHANGED
|
@@ -183,30 +183,30 @@ def generate(*data):
|
|
| 183 |
for i in range(visible + 1):
|
| 184 |
structure = struct_ref[2 * i]
|
| 185 |
reference = struct_ref[2 * i + 1]
|
| 186 |
-
if len((structure + reference).strip())
|
| 187 |
-
visible = i
|
| 188 |
-
break
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
|
| 211 |
description = ""
|
| 212 |
|
|
|
|
| 183 |
for i in range(visible + 1):
|
| 184 |
structure = struct_ref[2 * i]
|
| 185 |
reference = struct_ref[2 * i + 1]
|
| 186 |
+
if len((structure + reference).strip()) > 0:
|
| 187 |
+
# visible = i
|
| 188 |
+
# break
|
| 189 |
+
messages = [
|
| 190 |
+
SystemMessage(content=f"""You are a helpful assistant that writes about products for ecommerce websites."""),
|
| 191 |
+
HumanMessage(content=f"""Write a product description with the following features.
|
| 192 |
+
Make sure that the description follows the structure of the reference structure.
|
| 193 |
+
Make sure to use markdown format for the output.
|
| 194 |
+
Make sure that the entire output is written entirely in language defined in the reference structure.
|
| 195 |
+
Use language that is suitable for the type of document specified in the reference structure.
|
| 196 |
+
Use a consistent tone of voice throughout the text.
|
| 197 |
+
If the reference text is not empty, write the product description in the tone of voice of the reference text.
|
| 198 |
+
Make sure to output the product description only, do not include any preceeding text like "Here is your product description".
|
| 199 |
+
Do not include any part of the reference structure in the output.
|
| 200 |
+
Do not use any of the excluded words in the output.
|
| 201 |
+
Make sure to include all of the included words in the output.
|
| 202 |
+
|
| 203 |
+
{feature + detected_features}
|
| 204 |
+
{intended_use}
|
| 205 |
+
Reference structure: {structure}
|
| 206 |
+
Reference text: {reference}
|
| 207 |
+
Included words: {included_words}
|
| 208 |
+
Excluded words: {excluded_words}"""),]
|
| 209 |
+
batch.append(messages)
|
| 210 |
|
| 211 |
description = ""
|
| 212 |
|