Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -126,11 +126,11 @@ Your task:
|
|
126 |
"shoes": "High-quality product image of brown leather boots, white background",
|
127 |
"hat": "Studio photo of a navy beret on a stand, isolated on white"
|
128 |
}
|
129 |
-
Respond only with a valid JSON object.
|
|
|
130 |
Do not include any explanations or markdown syntax. No commentary. No extra text.
|
131 |
Start directly with `{` and end with `}`.
|
132 |
-
|
133 |
-
Do not forget commas between entries. Validate before finishing your response.
|
134 |
"""
|
135 |
|
136 |
prompt = f"""<|system|>
|
@@ -139,7 +139,7 @@ Do not forget commas between entries. Validate before finishing your response.
|
|
139 |
"{outfit_sentence}"</s>
|
140 |
"""
|
141 |
|
142 |
-
outputs = pipe(prompt, max_new_tokens=512, temperature=0.7, top_p=0.9)
|
143 |
pattern = r'\<\|system\|\>(.*?)\<\|assistant\|\>'
|
144 |
cleaned_text = re.sub(pattern, '', outputs[0]["generated_text"], flags=re.DOTALL)
|
145 |
print(f"\n🧾 Raw LLM response:\n{cleaned_text}")
|
|
|
126 |
"shoes": "High-quality product image of brown leather boots, white background",
|
127 |
"hat": "Studio photo of a navy beret on a stand, isolated on white"
|
128 |
}
|
129 |
+
Respond only with a valid JSON object. Ensure the JSON is properly formatted with correct commas between fields.
|
130 |
+
Do not forget commas between entries. Validate before finishing your response.
|
131 |
Do not include any explanations or markdown syntax. No commentary. No extra text.
|
132 |
Start directly with `{` and end with `}`.
|
133 |
+
|
|
|
134 |
"""
|
135 |
|
136 |
prompt = f"""<|system|>
|
|
|
139 |
"{outfit_sentence}"</s>
|
140 |
"""
|
141 |
|
142 |
+
outputs = pipe(prompt, max_new_tokens=512, temperature=0.7, top_k=50, top_p=0.9)
|
143 |
pattern = r'\<\|system\|\>(.*?)\<\|assistant\|\>'
|
144 |
cleaned_text = re.sub(pattern, '', outputs[0]["generated_text"], flags=re.DOTALL)
|
145 |
print(f"\n🧾 Raw LLM response:\n{cleaned_text}")
|