few more explicit UTF-8 encodings

This commit is contained in:
svlandeg 2025-11-03 21:46:39 +01:00
parent c72b8b2309
commit e22fc6f2fa

View File

@ -37,7 +37,7 @@ from concurrent.futures import ThreadPoolExecutor, as_completed
from nanochat.common import get_base_dir from nanochat.common import get_base_dir
api_key = open("openroutertoken.txt").read().strip() api_key = open("openroutertoken.txt", 'r', encoding='utf-8').read().strip()
url = "https://openrouter.ai/api/v1/chat/completions" url = "https://openrouter.ai/api/v1/chat/completions"
headers = { headers = {
@ -45,7 +45,7 @@ headers = {
"Content-Type": "application/json" "Content-Type": "application/json"
} }
readme = open("README.md").read().strip() readme = open("README.md", 'r', encoding='utf-8').read().strip()
prompt = r""" prompt = r"""
I want to generate synthetic data for an LLM to teach it about its identity. Here is the identity I want: I want to generate synthetic data for an LLM to teach it about its identity. Here is the identity I want: