Spaces:
Running
on
Zero
Running
on
Zero
fda
Browse files
mysite/routers/fastapi.py
CHANGED
@@ -271,7 +271,7 @@ def setup_webhook_routes(app: FastAPI):
|
|
271 |
#下記参考にAPIも作成しておいて
|
272 |
action insert list edit update でCRUDがかわる
|
273 |
同じようにGASのAPIも作成しておいて
|
274 |
-
|
275 |
def create_vector():
|
276 |
inputs = tokenizer(result, return_tensors="pt", max_length=512, truncation=True)
|
277 |
outputs = model(**inputs)
|
@@ -317,16 +317,16 @@ def setup_webhook_routes(app: FastAPI):
|
|
317 |
thread_name = send_google_chat_card_thread(webhook_url, title, subtitle, link_text, link_url,thread_name)
|
318 |
#########################################################################
|
319 |
from babyagi.babyagi import completion
|
320 |
-
import tempfile
|
321 |
-
|
|
|
322 |
|
323 |
proc = subprocess.Popen(
|
324 |
command,
|
325 |
stdin=subprocess.PIPE,
|
326 |
stdout=subprocess.PIPE,
|
327 |
stderr=subprocess.PIPE,
|
328 |
-
text=True,
|
329 |
-
shell=True
|
330 |
)
|
331 |
#thread_name = send_google_chat_card_thread(webhook_url, title, proc, link_text, link_url,thread_name)
|
332 |
|
|
|
271 |
#下記参考にAPIも作成しておいて
|
272 |
action insert list edit update でCRUDがかわる
|
273 |
同じようにGASのAPIも作成しておいて
|
274 |
+
|
275 |
def create_vector():
|
276 |
inputs = tokenizer(result, return_tensors="pt", max_length=512, truncation=True)
|
277 |
outputs = model(**inputs)
|
|
|
317 |
thread_name = send_google_chat_card_thread(webhook_url, title, subtitle, link_text, link_url,thread_name)
|
318 |
#########################################################################
|
319 |
from babyagi.babyagi import completion
|
320 |
+
#import tempfile
|
321 |
+
text = text.replace("\r\n","")
|
322 |
+
command = f"""make runbabyagi "{text}に対して、より良いチャットボットでのQAプランデータ設定の提案を日本語で作成してください"""
|
323 |
|
324 |
proc = subprocess.Popen(
|
325 |
command,
|
326 |
stdin=subprocess.PIPE,
|
327 |
stdout=subprocess.PIPE,
|
328 |
stderr=subprocess.PIPE,
|
329 |
+
text=True,
|
|
|
330 |
)
|
331 |
#thread_name = send_google_chat_card_thread(webhook_url, title, proc, link_text, link_url,thread_name)
|
332 |
|