Update nand.py
Browse files
nand.py
CHANGED
|
@@ -68,7 +68,9 @@ def process_query(iniquery, para):
|
|
| 68 |
print(f"THE QUERY SCORE for creating eco script: score={needScriptScores[0]}")
|
| 69 |
allapis = []
|
| 70 |
threshold = 0.45
|
|
|
|
| 71 |
if needScriptScores[0] > threshold:
|
|
|
|
| 72 |
print(f"THE QUERY REQUIRES CREATING AN ECO SCRIPT score={needScriptScores[0]} > {threshold}")
|
| 73 |
retinsts = insts_db.similarity_search_with_score(query, k=10)
|
| 74 |
accu = 0
|
|
@@ -161,8 +163,8 @@ def process_query(iniquery, para):
|
|
| 161 |
print(f"Prompt len: {prolen} LLMOUT len: {outlen}")
|
| 162 |
return llmout
|
| 163 |
allret = "LLM_OUTPUT_START:"+llmout+"\nEND OF LLM OUTPUT\n"+prompt
|
| 164 |
-
return allret
|
| 165 |
-
return ret
|
| 166 |
|
| 167 |
def toEn(intxt):
|
| 168 |
pattern = re.compile(r'[\u4e00-\u9fff]+')
|
|
|
|
| 68 |
print(f"THE QUERY SCORE for creating eco script: score={needScriptScores[0]}")
|
| 69 |
allapis = []
|
| 70 |
threshold = 0.45
|
| 71 |
+
itiscript = 0
|
| 72 |
if needScriptScores[0] > threshold:
|
| 73 |
+
itisscript = 1
|
| 74 |
print(f"THE QUERY REQUIRES CREATING AN ECO SCRIPT score={needScriptScores[0]} > {threshold}")
|
| 75 |
retinsts = insts_db.similarity_search_with_score(query, k=10)
|
| 76 |
accu = 0
|
|
|
|
| 163 |
print(f"Prompt len: {prolen} LLMOUT len: {outlen}")
|
| 164 |
return llmout
|
| 165 |
allret = "LLM_OUTPUT_START:"+llmout+"\nEND OF LLM OUTPUT\n"+prompt
|
| 166 |
+
return itisscript,allret
|
| 167 |
+
return itisscript,ret
|
| 168 |
|
| 169 |
def toEn(intxt):
|
| 170 |
pattern = re.compile(r'[\u4e00-\u9fff]+')
|