implement fun search
My implementation of https://deepmind.google/discover/blog/funsearch-making-new-discoveries-in-mathematical-sciences-using-large-language-models/
cd sandbox
OPENAI_API_KEY=your_openai_api_key GROQ_API_KEY=your_groq_api_key # Optional, but make sure none of the seed_db examples use groq.
docker build -t code-sandbox .
Run a container from the image:
docker run -it --rm -v $(pwd)/data:/data -v $(pwd)/scripts:/sandbox/scripts code-sandbox
This command will:
scripts
directory to /sandbox/scripts
in the containerThe database will be stored in the data
directory, which persists between container runs.
In the Python shell, you can interact with the SQLite database:
import sqlite3 conn = sqlite3.connect('/data/example.db') cursor = conn.cursor() # Query the users table cursor.execute("SELECT FROM users") print(cursor.fetchall()) conn.close()
You can modify the init.sh script in the project directory to customize the startup process or add more initialization steps.
Rebuild the Docker image when you change the Dockerfile, requirements.txt, or init.sh:
docker build -t code-sandbox .
If you update .env or scripts after building, you don't need to rebuild. These are mounted at runtime.
The scripts
directory is mounted as a volume, so any changes made to the local scripts
directory will be immediately reflected in the container. You don't need to rebuild the image to update scripts.