Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -62,8 +62,13 @@ if st.button("Enhance Prompt"):
|
|
62 |
temperature=0.3, # Low randomness
|
63 |
max_tokens=max_tokens # Ensure integer value
|
64 |
)
|
|
|
65 |
enhanced_prompt = completion.choices[0].message.content.strip()
|
66 |
|
|
|
|
|
|
|
|
|
67 |
# ๐ Display Enhanced Prompt in a Larger Text Box
|
68 |
st.subheader("๐น Enhanced Prompt:")
|
69 |
st.text_area(" ", value=enhanced_prompt, height=250) # Bigger text box
|
|
|
62 |
temperature=0.3, # Low randomness
|
63 |
max_tokens=max_tokens # Ensure integer value
|
64 |
)
|
65 |
+
# Ensure OpenAI returns only plain text
|
66 |
enhanced_prompt = completion.choices[0].message.content.strip()
|
67 |
|
68 |
+
# Remove markdown-style bold formatting (**text**)
|
69 |
+
import re
|
70 |
+
enhanced_prompt = re.sub(r"\*\*(.*?)\*\*", r"\1", enhanced_prompt)
|
71 |
+
|
72 |
# ๐ Display Enhanced Prompt in a Larger Text Box
|
73 |
st.subheader("๐น Enhanced Prompt:")
|
74 |
st.text_area(" ", value=enhanced_prompt, height=250) # Bigger text box
|