Spaces:
Running
on
Zero
Running
on
Zero
fda
Browse files- babyagi/babyagi.py +2 -1
- babyagi/classesa/phprunner.py +62 -0
- chat_history.db +0 -0
- chroma/chroma.sqlite3 +2 -2
- controllers/gpt_enginner20240624123227 +1 -0
- controllers/gpt_enginner20240624124500 +1 -0
- controllers/gpt_enginner20240624130344 +1 -0
- controllers/gpt_enginner20240624130952 +1 -0
- workspace/jewelry_app/__init__.py +0 -0
- workspace/jewelry_app/admin.py +0 -0
- workspace/jewelry_app/apps.py +0 -0
- workspace/jewelry_app/models.py +0 -0
- workspace/jewelry_app/tests.py +0 -0
- workspace/jewelry_app/views.py +0 -0
- workspace/main.py +0 -0
- workspace/project/main.py +0 -0
babyagi/babyagi.py
CHANGED
@@ -889,6 +889,7 @@ def completion(message: str, history=None, c=None, d=None, prompt="あなたは
|
|
889 |
result_all = ""
|
890 |
count = 0
|
891 |
while loop:
|
|
|
892 |
# As long as there are tasks in the storage...
|
893 |
if not tasks_storage.is_empty():
|
894 |
#OBJECTIVE = "ボットの性能をよくする方法 日本語で説明"
|
@@ -952,7 +953,7 @@ def completion(message: str, history=None, c=None, d=None, prompt="あなたは
|
|
952 |
# Sleep a bit before checking the task list again
|
953 |
time.sleep(1)
|
954 |
count += 1
|
955 |
-
if count >
|
956 |
loop = False
|
957 |
else:
|
958 |
print('Done.')
|
|
|
889 |
result_all = ""
|
890 |
count = 0
|
891 |
while loop:
|
892 |
+
result_all = ""
|
893 |
# As long as there are tasks in the storage...
|
894 |
if not tasks_storage.is_empty():
|
895 |
#OBJECTIVE = "ボットの性能をよくする方法 日本語で説明"
|
|
|
953 |
# Sleep a bit before checking the task list again
|
954 |
time.sleep(1)
|
955 |
count += 1
|
956 |
+
if count > 2:
|
957 |
loop = False
|
958 |
else:
|
959 |
print('Done.')
|
babyagi/classesa/phprunner.py
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/usr/bin/env python3
|
2 |
+
from dotenv import load_dotenv
|
3 |
+
|
4 |
+
# Load default environment variables (.env)
|
5 |
+
load_dotenv()
|
6 |
+
|
7 |
+
import os
|
8 |
+
import time
|
9 |
+
import logging
|
10 |
+
from collections import deque
|
11 |
+
from typing import Dict, List
|
12 |
+
import importlib
|
13 |
+
import openai
|
14 |
+
import chromadb
|
15 |
+
import tiktoken as tiktoken
|
16 |
+
from chromadb.utils.embedding_functions import OpenAIEmbeddingFunction
|
17 |
+
from chromadb.api.types import Documents, EmbeddingFunction, Embeddings
|
18 |
+
import re
|
19 |
+
from groq import Groq
|
20 |
+
|
21 |
+
# default opt out of chromadb telemetry.
|
22 |
+
from chromadb.config import Settings
|
23 |
+
from transformers import AutoTokenizer, AutoModel
|
24 |
+
import torch
|
25 |
+
import numpy
|
26 |
+
|
27 |
+
import psycopg2
|
28 |
+
import shutil
|
29 |
+
import gradio as gr
|
30 |
+
from mysite.libs.utilities import chat_with_interpreter, completion, process_file
|
31 |
+
from interpreter import interpreter
|
32 |
+
import mysite.interpreter.interpreter_config # インポートするだけで設定が適用されます
|
33 |
+
import importlib
|
34 |
+
import os
|
35 |
+
import pkgutil
|
36 |
+
import async_timeout
|
37 |
+
import asyncio
|
38 |
+
import sys
|
39 |
+
from mysite.interpreter.google_chat import send_google_chat_card
|
40 |
+
|
41 |
+
|
42 |
+
def create_vector():
|
43 |
+
inputs = tokenizer(result, return_tensors="pt", max_length=512, truncation=True)
|
44 |
+
outputs = model(**inputs)
|
45 |
+
# [CLS]トークンの出力を取得
|
46 |
+
embeddings = outputs.last_hidden_state[:,0,:].squeeze().detach().cpu().numpy().tolist()
|
47 |
+
print(embeddings)
|
48 |
+
import requests
|
49 |
+
|
50 |
+
url = "https://kenken999-php.hf.space/api/v1.php"
|
51 |
+
|
52 |
+
payload = f"""model_name={embeddings}&vector_text={result}&table=products&action=insert"""
|
53 |
+
headers = {
|
54 |
+
'X-Auth-Token': 'admin',
|
55 |
+
'Content-Type': 'application/x-www-form-urlencoded',
|
56 |
+
'Cookie': 'runnerSession=muvclb78zpsdjbm7y9c3; pD1lszvk6ratOZhmmgvkp=13767810ebf0782b0b51bf72dedb63b3'
|
57 |
+
}
|
58 |
+
|
59 |
+
response = requests.request("POST", url, headers=headers, data=payload)
|
60 |
+
|
61 |
+
print(response.text)
|
62 |
+
return True
|
chat_history.db
CHANGED
Binary files a/chat_history.db and b/chat_history.db differ
|
|
chroma/chroma.sqlite3
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:757415bd2b525c2e8f34b5556daf1f865d9bd17638cc47766ff80e5670340d13
|
3 |
+
size 1150976
|
controllers/gpt_enginner20240624123227
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
Subproject commit db8571fe736838dacd80d90255873ef16c777c83
|
controllers/gpt_enginner20240624124500
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
Subproject commit 72bcab872dbddbba6ee82625a14a0c12cf573a45
|
controllers/gpt_enginner20240624130344
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
Subproject commit 4b27de24c50202c72b39e2c6142ed16a8c869134
|
controllers/gpt_enginner20240624130952
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
Subproject commit ded9423ac929cb41ba77648b88798b48cc564268
|
workspace/jewelry_app/__init__.py
ADDED
File without changes
|
workspace/jewelry_app/admin.py
ADDED
File without changes
|
workspace/jewelry_app/apps.py
ADDED
File without changes
|
workspace/jewelry_app/models.py
ADDED
File without changes
|
workspace/jewelry_app/tests.py
ADDED
File without changes
|
workspace/jewelry_app/views.py
ADDED
File without changes
|
workspace/main.py
ADDED
File without changes
|
workspace/project/main.py
ADDED
File without changes
|