Spaces:
Running
on
Zero
Running
on
Zero
fda
Browse files- chat_history.db +0 -0
- controllers/gpt_enginner20240624114228 +1 -0
- mysite/routers/fastapi.py +25 -0
chat_history.db
CHANGED
Binary files a/chat_history.db and b/chat_history.db differ
|
|
controllers/gpt_enginner20240624114228
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
Subproject commit 79fe70060096bff3cef4164f2054a3c13c8ea5a3
|
mysite/routers/fastapi.py
CHANGED
@@ -268,6 +268,31 @@ def setup_webhook_routes(app: FastAPI):
|
|
268 |
仕様書の作成
|
269 |
PlantUMLでシーケンス図の作成
|
270 |
Markdownでのプログラム殺名
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
271 |
|
272 |
下記の質問 作成対応内容
|
273 |
|
|
|
268 |
仕様書の作成
|
269 |
PlantUMLでシーケンス図の作成
|
270 |
Markdownでのプログラム殺名
|
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)
|
278 |
+
# [CLS]トークンの出力を取得
|
279 |
+
embeddings = outputs.last_hidden_state[:,0,:].squeeze().detach().cpu().numpy().tolist()
|
280 |
+
print(embeddings)
|
281 |
+
import requests
|
282 |
+
|
283 |
+
url = "https://kenken999-php.hf.space/api/v1.php"
|
284 |
+
|
285 |
+
payload = "model_name={embeddings}&vector_text={result}&table=products&action=insert""
|
286 |
+
headers = {
|
287 |
+
'X-Auth-Token': 'admin',
|
288 |
+
'Content-Type': 'application/x-www-form-urlencoded',
|
289 |
+
'Cookie': 'runnerSession=muvclb78zpsdjbm7y9c3; pD1lszvk6ratOZhmmgvkp=13767810ebf0782b0b51bf72dedb63b3'
|
290 |
+
}
|
291 |
+
|
292 |
+
response = requests.request("POST", url, headers=headers, data=payload)
|
293 |
+
|
294 |
+
print(response.text)
|
295 |
+
return True
|
296 |
|
297 |
下記の質問 作成対応内容
|
298 |
|