set LM
This commit is contained in:
15
main.py
15
main.py
@@ -1,9 +1,18 @@
|
||||
from dotenv import load_dotenv
|
||||
import os
|
||||
import dspy
|
||||
from dotenv import load_dotenv
|
||||
from modaic import PrecompiledProgram, PrecompiledConfig
|
||||
from src.neo4j import Neo4j
|
||||
|
||||
load_dotenv()
|
||||
|
||||
# set up Neo4j using NEO4J_URI
|
||||
neo4j = Neo4j(
|
||||
uri=os.getenv("NEO4J_URI"),
|
||||
user=os.getenv("NEO4J_USER"),
|
||||
password=os.getenv("NEO4J_PASSWORD"),
|
||||
)
|
||||
|
||||
class CypherFromText(dspy.Signature):
|
||||
"""Instructions:
|
||||
Create a Cypher MERGE statement to model all entities and relationships found in the text following these guidelines:
|
||||
@@ -21,7 +30,7 @@ class CypherFromText(dspy.Signature):
|
||||
|
||||
class GenerateCypherConfig(PrecompiledConfig):
|
||||
neo4j_schema: list[str] = []
|
||||
model: str = "gpt-4"
|
||||
model: str = "openai/gpt-4o"
|
||||
max_tokens: int = 1024
|
||||
|
||||
|
||||
@@ -43,6 +52,6 @@ class GenerateCypher(PrecompiledProgram):
|
||||
|
||||
if __name__ == "__main__":
|
||||
generate_cypher = GenerateCypher(GenerateCypherConfig())
|
||||
generate_cypher.push_to_hub("farouk1/text-to-cypher", with_code=True, tag="v0.0.2", commit_message="set LM")
|
||||
generate_cypher.push_to_hub("farouk1/text-to-cypher", with_code=True, tag="v0.0.3", commit_message="set LM")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user