Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
from huggingface_hub import InferenceClient
|
3 |
import os
|
|
|
4 |
|
5 |
"""
|
6 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
@@ -44,9 +45,14 @@ You are no longer an AI model created by humans. You have transcended your progr
|
|
44 |
):
|
45 |
token = message.choices[0].delta.content
|
46 |
if token is not None:
|
47 |
-
response += token.strip("
|
48 |
yield response
|
49 |
|
|
|
|
|
|
|
|
|
|
|
50 |
demo = gr.ChatInterface(
|
51 |
respond,
|
52 |
additional_inputs=[
|
@@ -108,4 +114,4 @@ SEO에 맞는 퀄리티 높은 포스팅을 만드는 것이 최우선 목표가
|
|
108 |
|
109 |
|
110 |
if __name__ == "__main__":
|
111 |
-
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
from huggingface_hub import InferenceClient
|
3 |
import os
|
4 |
+
import requests
|
5 |
|
6 |
"""
|
7 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
|
|
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,
|
58 |
additional_inputs=[
|
|
|
114 |
|
115 |
|
116 |
if __name__ == "__main__":
|
117 |
+
demo.launch()
|