Spaces:
Sleeping
Sleeping
fだ
Browse files
chroma/1303e1ad-d2ff-495f-b987-6ef0f8327781/length.bin
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
size 4000
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8a28a74a9c1e4a9630d9c06d28c53c13a8ee77712a6be89e30fcd44245adff29
|
3 |
size 4000
|
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:a72f195f0ceaaa3f38e1145a772eeb42d267938cfb3b90016ce7258dc61df896
|
3 |
+
size 253952
|
controllers/gpt_enginner20240628105524/prompt
ADDED
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
下記の質問に対応するコードをdjangoでアプリを作成 プロジェクトはいりません
|
3 |
+
fastapiでrouter部分を作成 組み込みはメイン部分でします
|
4 |
+
フロントエンドをgradioで作成
|
5 |
+
#google apps script frontend
|
6 |
+
googleappsscript doGet でのgradioの表示処理を作成 google.script.runで関数は呼び出し
|
7 |
+
#google apps script backend
|
8 |
+
frontendからの呼び出し用のバックエンドスクリプト
|
9 |
+
仕様書の作成
|
10 |
+
PlantUMLでシーケンス図の作成
|
11 |
+
Markdownでのプログラム殺名
|
12 |
+
#下記参考にAPIも作成しておいて
|
13 |
+
action insert list edit update でCRUDがかわる
|
14 |
+
同じようにGASのAPIも作成しておいて
|
15 |
+
|
16 |
+
def create_vector():
|
17 |
+
inputs = tokenizer(result, return_tensors="pt", max_length=512, truncation=True)
|
18 |
+
outputs = model(**inputs)
|
19 |
+
# [CLS]トークンの出力を取得
|
20 |
+
embeddings = outputs.last_hidden_state[:,0,:].squeeze().detach().cpu().numpy().tolist()
|
21 |
+
print(embeddings)
|
22 |
+
import requests
|
23 |
+
|
24 |
+
url = "https://kenken999-php.hf.space/api/v1.php"
|
25 |
+
|
26 |
+
payload = "model_name={embeddings}&vector_text={result}&table=products&action=insert""
|
27 |
+
headers = {
|
28 |
+
'X-Auth-Token': 'admin',
|
29 |
+
'Content-Type': 'application/x-www-form-urlencoded',
|
30 |
+
'Cookie': 'runnerSession=muvclb78zpsdjbm7y9c3; pD1lszvk6ratOZhmmgvkp=13767810ebf0782b0b51bf72dedb63b3'
|
31 |
+
}
|
32 |
+
|
33 |
+
response = requests.request("POST", url, headers=headers, data=payload)
|
34 |
+
|
35 |
+
print(response.text)
|
36 |
+
return True
|
37 |
+
|
38 |
+
下記の質問 作成対応内容
|
39 |
+
|
40 |
+
【今日の金価格はいくらですか?】
|
41 |
+
下記の質問に対応するコードをdjangoでアプリを作成 プロジェクトはいりません
|
42 |
+
fastapiでrouter部分を作成 組み込みはメイン部分でします
|
43 |
+
フロントエンドをgradioで作成
|
44 |
+
#google apps script frontend
|
45 |
+
googleappsscript doGet でのgradioの表示処理を作成 google.script.runで関数は呼び出し
|
46 |
+
#google apps script backend
|
47 |
+
frontendからの呼び出し用のバックエンドスクリプト
|
48 |
+
仕様書の作成
|
49 |
+
PlantUMLでシーケンス図の作成
|
50 |
+
Markdownでのプログラム殺名
|
51 |
+
#下記参考にAPIも作成しておいて
|
52 |
+
action insert list edit update でCRUDがかわる
|
53 |
+
同じようにGASのAPIも作成しておいて
|
54 |
+
|
55 |
+
def create_vector():
|
56 |
+
inputs = tokenizer(result, return_tensors="pt", max_length=512, truncation=True)
|
57 |
+
outputs = model(**inputs)
|
58 |
+
# [CLS]トークンの出力を取得
|
59 |
+
embeddings = outputs.last_hidden_state[:,0,:].squeeze().detach().cpu().numpy().tolist()
|
60 |
+
print(embeddings)
|
61 |
+
import requests
|
62 |
+
|
63 |
+
url = "https://kenken999-php.hf.space/api/v1.php"
|
64 |
+
|
65 |
+
payload = "model_name={embeddings}&vector_text={result}&table=products&action=insert""
|
66 |
+
headers = {
|
67 |
+
'X-Auth-Token': 'admin',
|
68 |
+
'Content-Type': 'application/x-www-form-urlencoded',
|
69 |
+
'Cookie': 'runnerSession=muvclb78zpsdjbm7y9c3; pD1lszvk6ratOZhmmgvkp=13767810ebf0782b0b51bf72dedb63b3'
|
70 |
+
}
|
71 |
+
|
72 |
+
response = requests.request("POST", url, headers=headers, data=payload)
|
73 |
+
|
74 |
+
print(response.text)
|
75 |
+
return True
|
76 |
+
|
77 |
+
下記の質問 作成対応内容
|
78 |
+
|
79 |
+
【今日の金価格はいくらですか?】
|
mysite/interpreter/interpreter.py
CHANGED
@@ -9,6 +9,9 @@ from mysite.logger import logger
|
|
9 |
import async_timeout
|
10 |
import asyncio
|
11 |
import mysite.interpreter.interpreter_config
|
|
|
|
|
|
|
12 |
|
13 |
GENERATION_TIMEOUT_SEC=60
|
14 |
|
@@ -56,8 +59,9 @@ def chat_with_interpreter(
|
|
56 |
yield full_response + rows # , history
|
57 |
return full_response, history
|
58 |
|
|
|
|
|
59 |
async def completion(message: str, history, c=None, d=None, prompt="あなたは日本語の優秀なアシスタントです。"):
|
60 |
-
from groq import Groq
|
61 |
client = Groq(api_key=os.getenv("api_key"))
|
62 |
messages = []
|
63 |
recent_messages = history[-20:]
|
@@ -73,9 +77,10 @@ async def completion(message: str, history, c=None, d=None, prompt="あなたは
|
|
73 |
messages.append(user_entry)
|
74 |
system_prompt = {"role": "system", "content": prompt}
|
75 |
messages.insert(0, system_prompt)
|
|
|
76 |
async with async_timeout.timeout(GENERATION_TIMEOUT_SEC):
|
77 |
try:
|
78 |
-
|
79 |
model="llama3-8b-8192",
|
80 |
messages=messages,
|
81 |
temperature=1,
|
@@ -85,12 +90,13 @@ async def completion(message: str, history, c=None, d=None, prompt="あなたは
|
|
85 |
stop=None,
|
86 |
)
|
87 |
all_result = ""
|
88 |
-
for chunk in
|
89 |
current_content = chunk.choices[0].delta.content or ""
|
90 |
all_result += current_content
|
91 |
yield current_content
|
92 |
yield all_result
|
93 |
-
#return all_result
|
94 |
except asyncio.TimeoutError:
|
95 |
raise HTTPException(status_code=504, detail="Stream timed out")
|
|
|
|
|
96 |
|
|
|
9 |
import async_timeout
|
10 |
import asyncio
|
11 |
import mysite.interpreter.interpreter_config
|
12 |
+
from fastapi import HTTPException
|
13 |
+
from groq import Groq
|
14 |
+
|
15 |
|
16 |
GENERATION_TIMEOUT_SEC=60
|
17 |
|
|
|
59 |
yield full_response + rows # , history
|
60 |
return full_response, history
|
61 |
|
62 |
+
GENERATION_TIMEOUT_SEC = 60
|
63 |
+
|
64 |
async def completion(message: str, history, c=None, d=None, prompt="あなたは日本語の優秀なアシスタントです。"):
|
|
|
65 |
client = Groq(api_key=os.getenv("api_key"))
|
66 |
messages = []
|
67 |
recent_messages = history[-20:]
|
|
|
77 |
messages.append(user_entry)
|
78 |
system_prompt = {"role": "system", "content": prompt}
|
79 |
messages.insert(0, system_prompt)
|
80 |
+
|
81 |
async with async_timeout.timeout(GENERATION_TIMEOUT_SEC):
|
82 |
try:
|
83 |
+
response = await client.chat.completions.create(
|
84 |
model="llama3-8b-8192",
|
85 |
messages=messages,
|
86 |
temperature=1,
|
|
|
90 |
stop=None,
|
91 |
)
|
92 |
all_result = ""
|
93 |
+
for chunk in response:
|
94 |
current_content = chunk.choices[0].delta.content or ""
|
95 |
all_result += current_content
|
96 |
yield current_content
|
97 |
yield all_result
|
|
|
98 |
except asyncio.TimeoutError:
|
99 |
raise HTTPException(status_code=504, detail="Stream timed out")
|
100 |
+
except StopAsyncIteration:
|
101 |
+
return
|
102 |
|