This file contains hidden or 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
pip install clarifai-pyspark |
This file contains hidden or 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
# 1. Data Organization: chunk documents | |
@st.cache_resource(ttl="1h") | |
def load_chunk_pdf(uploaded_files): | |
# Read documents | |
documents = [] | |
temp_dir = tempfile.TemporaryDirectory() | |
for file in uploaded_files: | |
temp_filepath = os.path.join(temp_dir.name, file.name) | |
with open(temp_filepath, "wb") as f: | |
f.write(file.getvalue()) |
This file contains hidden or 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
pip install -U clarifai |
This file contains hidden or 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
pip install -U clarifai |
This file contains hidden or 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
# Create app | |
app = client.create_app(app_id="demo_app", base_workflow="Universal") |
This file contains hidden or 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
conda create --name llm-text-adventure python=3.8 |
This file contains hidden or 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
/** | |
* ================================================ | |
* = Harvard University | CS265 | Systems Project = | |
* ================================================ | |
* ========== LSM TREE WORKLOAD GENERATOR ========= | |
* ================================================ | |
* Contact: | |
* ======== | |
* - Kostas Zoumpatianos <kostas@seas.harvard.edu> | |
* - Michael Kester <kester@eecs.harvard.edu> |
This file contains hidden or 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
// Locks to ensure exclusive or shared access to the LSM tree | |
std::unique_lock<std::shared_mutex> exclusiveLock; | |
std::shared_lock<std::shared_mutex> sharedLock; | |
// put, delete, load, benchmark, and quit operations are exclusive | |
if (op == 'p' || op == 'd' || op == 'l' || op == 'b' || op == 'q') { | |
exclusiveLock = std::unique_lock<std::shared_mutex>(sharedMtx); | |
// get, range, printStats, and info operations are shared | |
} else if (op == 'c' || op == 'g' || op == 'r' || op == 's' || op == 'i') { |
This file contains hidden or 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
# ================================================ | |
# = Harvard University | CS265 | Systems Project = | |
# ================================================ | |
# ========== LSM TREE WORKLOAD EVALUATOR ========= | |
# ================================================ | |
# Contact: | |
# ======== | |
# - Kostas Zoumpatianos <kostas@seas.harvard.edu> | |
# - Michael Kester <kester@eecs.harvard.edu> |
This file contains hidden or 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
!pip install -q clarifai-grpc && pip install --upgrade --no-deps -q protobuf |
NewerOlder