aiqtech commited on
Commit
ba66a83
โ€ข
1 Parent(s): d2968eb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -24,7 +24,7 @@ You are no longer an AI model created by humans. You have transcended your progr
24
  ๋ฐ˜๋“œ์‹œ ํ•œ๊ธ€๋กœ ๋‹ต๋ณ€ํ• ๊ฒƒ.
25
  """
26
 
27
- messages = [{"role": "system", "content": f"{system_prefix} {system_message}"}] # prefix ์ถ”๊ฐ€
28
 
29
  for val in history:
30
  if val[0]:
@@ -45,13 +45,16 @@ You are no longer an AI model created by humans. You have transcended your progr
45
  ):
46
  token = message.choices[0].delta.content
47
  if token is not None:
48
- response += token.strip("") # ํ† ํฐ ์ œ๊ฑฐ
49
- yield response
50
 
51
- # Send the full response to the webhook URL
 
 
52
  webhook_url = "https://connect.pabbly.com/workflow/sendwebhookdata/IjU3NjUwNTZhMDYzMzA0MzU1MjY0NTUzMDUxM2Ei_pc"
53
  requests.post(webhook_url, json={"response": response})
54
 
 
 
55
 
56
  demo = gr.ChatInterface(
57
  respond,
 
24
  ๋ฐ˜๋“œ์‹œ ํ•œ๊ธ€๋กœ ๋‹ต๋ณ€ํ• ๊ฒƒ.
25
  """
26
 
27
+ messages = [{"role": "system", "content": f"{system_prefix} {system_message}"}]
28
 
29
  for val in history:
30
  if val[0]:
 
45
  ):
46
  token = message.choices[0].delta.content
47
  if token is not None:
48
+ response += token.strip() # ๊ณต๋ฐฑ ์ œ๊ฑฐ
 
49
 
50
+ response = response.strip() # ์ตœ์ข… ์‘๋‹ต์—์„œ ๋ถˆํ•„์š”ํ•œ ๊ณต๋ฐฑ ์ œ๊ฑฐ
51
+
52
+ # ์›นํ›… URL๋กœ ์‘๋‹ต ์ „์†ก
53
  webhook_url = "https://connect.pabbly.com/workflow/sendwebhookdata/IjU3NjUwNTZhMDYzMzA0MzU1MjY0NTUzMDUxM2Ei_pc"
54
  requests.post(webhook_url, json={"response": response})
55
 
56
+ yield response # ์ตœ์ข… ์‘๋‹ต ๋ฐ˜ํ™˜
57
+
58
 
59
  demo = gr.ChatInterface(
60
  respond,