docker run -d \
-p 7474:7474 -p 7687:7687 \
--env NEO4J_PLUGINS='["apoc", "apoc-extended", "graph-data-science", "n10s"]' \
--name=neo4j \
--restart=unless-stopped \
neo4j:5.20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Neo4jConnection: | |
def __init__(self, uri, user, pwd): | |
self.__uri = uri | |
self.__user = user | |
self.__pwd = pwd | |
self.__driver = None | |
try: | |
self.__driver = GraphDatabase.driver(self.__uri, auth=(self.__user, self.__pwd)) | |
except Exception as e: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Neo4jConnection: | |
def __init__(self, uri, user, pwd): | |
self.__uri = uri | |
self.__user = user | |
self.__pwd = pwd | |
self.__driver = None | |
try: | |
self.__driver = GraphDatabase.driver(self.__uri, auth=(self.__user, self.__pwd)) | |
except Exception as e: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ell | |
import openai | |
import ell.lmp.simple | |
ell.config.verbose = True | |
client = openai.Client(base_url='http://localhost:11434/v1/', api_key='ollama') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import srsly | |
def chunk_iterable(item_list: list[JsonBlob], chunksize: int) -> Iterator[list[JsonBlob]]: | |
""" | |
Break a large iterable into an iterable of smaller iterables | |
""" | |
for i in range(0, len(item_list), chunksize): | |
yield item_list[i : i + chunksize] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
graph LR | |
User[User] | |
Device[Device] | |
Transaction[Transaction] | |
Account[Account] | |
MerchantAccount[Merchant Account] | |
IPAddress[IP Address] | |
PhoneNumber[Phone Number] | |
DigitalWallet[Digital Wallet] | |
Token[Token] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"models": [ | |
{ | |
"model": "llama3.1:8b-instruct-q6_K", | |
"title": "Llama3.1-8b-instruct (ollama)", | |
"contextLength": 8192, | |
"completionOptions": { | |
"stop": ["<|eot_id|>"], | |
"maxTokens": 7000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def quadrant_chart(x, y, xtick_labels=None, ytick_labels=None, data_labels=None, | |
highlight_quadrants=None, ax=None): | |
""" | |
Create the classic four-quadrant chart. | |
Args: | |
x -- array-like, the x-coordinates to plot | |
y -- array-like, the y-coordinates to plot | |
xtick_labels -- list, default: None, a two-value list xtick labels | |
ytick_labels -- list, default: None, a two-value list of ytick labels | |
data_labels -- array-like, default: None, data point annotations |