aifeifei798 commited on
Commit
fa7256b
·
verified ·
1 Parent(s): 10c9046

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -8,6 +8,12 @@ client = OpenAI(
8
  api_key = os.getenv("NvidiaAPI")
9
  )
10
 
 
 
 
 
 
 
11
  def feifeiprompt( message_text="", history="", feifei_select=True,):
12
  input_prompt = []
13
  if message_text.startswith("画") or message_text.startswith("draw"):
@@ -61,7 +67,7 @@ def feifeiprompt( message_text="", history="", feifei_select=True,):
61
  },
62
  {
63
  "role": "user",
64
- "content": f"Create an imaginative image descriptive caption for the user input : {message_text}"
65
  }
66
  ]
67
  return messages
 
8
  api_key = os.getenv("NvidiaAPI")
9
  )
10
 
11
+ def clean_string(s):
12
+ s = s.replace("\n", " ")
13
+ s = s.strip()
14
+ s = re.sub(r"\s{2,}", " ", s)
15
+ return s
16
+
17
  def feifeiprompt( message_text="", history="", feifei_select=True,):
18
  input_prompt = []
19
  if message_text.startswith("画") or message_text.startswith("draw"):
 
67
  },
68
  {
69
  "role": "user",
70
+ "content": f"Create an imaginative image descriptive caption for the user input : {message_text},使用英文回复"
71
  }
72
  ]
73
  return messages