Install MLX LM:
pip install mlx-lm
And run:
import anthropic | |
import os | |
import sys | |
from termcolor import colored | |
from dotenv import load_dotenv | |
class ClaudeAgent: | |
def __init__(self, api_key=None, model="claude-3-7-sonnet-20250219", max_tokens=4000): | |
"""Initialize the Claude agent with API key and model.""" |
Understand the Task: Grasp the main objective, goals, requirements, constraints, and expected output. | |
- Minimal Changes: If an existing prompt is provided, improve it only if it's simple. For complex prompts, enhance clarity and add missing elements without altering the original structure. | |
- Reasoning Before Conclusions: Encourage reasoning steps before any conclusions are reached. ATTENTION! If the user provides examples where the reasoning happens afterward, REVERSE the order! NEVER START EXAMPLES WITH CONCLUSIONS! | |
- Reasoning Order: Call out reasoning portions of the prompt and conclusion parts (specific fields by name). For each, determine the ORDER in which this is done, and whether it needs to be reversed. | |
- Conclusion, classifications, or results should ALWAYS appear last. | |
- Examples: Include high-quality examples if helpful, using placeholders [in brackets] for complex elements. | |
- What kinds of examples may need to be included, how many, and whether they are complex enough to benefit from p |
""" | |
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
BSD License | |
""" | |
import numpy as np | |
# data I/O | |
data = open('input.txt', 'r').read() # should be simple plain text file | |
chars = list(set(data)) | |
data_size, vocab_size = len(data), len(chars) |
(ns datastructures.queue | |
(:refer-clojure :exclude [compare-and-set! pop]) | |
(:import java.util.concurrent.atomic.AtomicReference)) | |
(defn- compare-and-set! [^AtomicReference aref oldval newval] | |
(or (.compareAndSet aref oldval newval) | |
(throw (RuntimeException. ::loop)))) | |
(defmacro with-contention | |
[& body] |
(ns your.namespace.async-util | |
(:require | |
[clojure.core.async :as a :refer [>! <! >!! <!! go chan buffer | |
close! thread alts! alts!! timeout]] | |
[clojure.core.match :as match :refer [match]])) | |
;; | |
;; core.async util fns | |
;; |
This tutorial is for computers with NVIDIA GPUs installed.
Tensorflow for GPU significantly reduces the time taken by Deep Neural Networks (like CNNs, LSTMs, etc) to complete each Epoch (compute cycle) by utilizing the CUDA cores present in the GPU for parallel processing.
The following steps are to be followed:
class MyChart { | |
constructor(){ | |
this.foo = "foo"; | |
return this; | |
} | |
sayFoo(){ |
import type File from "File"; | |
import type FileService from "FileService"; | |
type FileDetailProps = { | |
file: File | |
}; | |
class FileDetail extends React.Component<FileDetailProps> { | |
render() { | |
// remove the file prop and flow will complain! |