hruday96 commited on
Commit
9a57779
ยท
verified ยท
1 Parent(s): be75daa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
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