You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
./local-ai run https://huggingface.co/tomasonjo/text2cypher-demo-4bit-gguf/resolve/main/text2cypher-demo-4bit-gguf-unsloth.Q4_K_M.gguf // List models
85
+
./local-ai run https://huggingface.co/tomasonjo/text2cypher-codestral-q4_k_m-gguf/resolve/main/text2cypher-codestral-q4_k_m-gguf-unsloth.Q4_K_M.gguf
86
+
# List Models
87
+
curl http://localhost:8080/v1/models
88
+
# Call model
89
+
curl http://localhost:8080/v1/chat/completions -H "Content-Type: application/json" -d '{"model":"text2cypher-demo-4bit-gguf-unsloth.Q4_K_M.gguf", "messages": [{"role": "user", "content": "What is the color of the sky? Answer in one word"}] }'
90
+
*/
91
+
String[] models = {
92
+
"text2cypher-demo-4bit-gguf-unsloth.Q4_K_M.gguf",
93
+
"text2cypher-demo-8bit-gguf-unsloth.Q8_0.gguf",
94
+
};
95
+
96
+
for (Stringmodel : models) {
97
+
testCall(db, CHAT_COMPLETION_QUERY,
98
+
getParams(model),
99
+
row -> assertChatCompletion(row, model));
100
+
}
101
+
}
102
+
103
+
@Test
104
+
publicvoidtext2CypherTomasonjo4Bit() {
105
+
assertNotNull(OPENAI_KEY);
106
+
Stringschema = """
107
+
Node properties are the following:
108
+
Movie {title: STRING, votes: INTEGER, tagline: STRING, released: INTEGER}, Person {born: INTEGER, name: STRING}
Copy file name to clipboardExpand all lines: extended/src/test/java/apoc/ml/OpenAITestResultUtils.java
+12-2Lines changed: 12 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,15 @@ public class OpenAITestResultUtils {
23
23
publicstaticfinalStringCOMPLETION_QUERY = "CALL apoc.ml.openai.completion('What color is the sky? Answer in one word: ', $apiKey, $conf)";
24
24
25
25
publicstaticfinalStringCOMPLETION_QUERY_EXTENDED_PROMPT = "CALL apoc.ml.openai.completion('\\n\\nHuman: What color is sky?\\n\\nAssistant:', $apiKey, $conf)";
26
-
26
+
publicstaticfinalStringTEXT_TO_CYPHER_QUERY = """
27
+
WITH $schema as schema, $question as question
28
+
CALL apoc.ml.openai.chat([
29
+
{role:"system", content:"Given an input question, convert it to a Cypher query. No pre-amble."},
30
+
{role:"user", content:"Based on the Neo4j graph schema below, write a Cypher query that would answer the user's question:
0 commit comments