Spaces:
Sleeping
Sleeping
293droid commited on
Commit ·
0937f0d
1
Parent(s): 8d19a5b
feat: water hardness mode with sodium citrate recommendation via Codex
Browse files1234567891011121314151617181920212223# Test 1: chemistry enginefrom chemistry import calculate_lye, score_recipe, find_substitutesrecipe = {"coconut oil": 150, "olive oil": 350}result = calculate_lye(recipe, superfat=5)print(f"✅ Chemistry engine: NaOH = {result['naoh_g']}g")# Test 2: Ollamaimport ollamaresponse = ollama.chat(model="llama3.2:latest",messages=[{"role": "user", "content": "Say hello in one sentence."}])print(f"✅ Ollama: {response['message']['content']}")# Test 3: HF loginfrom huggingface_hub import whoamiuser = whoami()print(f"✅ HF logged in as: {user['name']}")≈12345678910111213141516171819202122232425262728293031import pytestfrom chemistry import calculate_lyedef test_chemistry_engine():recipe = {"coconut oil": 150, "olive oil": 350}result = calculate_lye(recipe, superfat=5)assert isinstance(result, dict)assert 'naoh_g' in resultdef test_ollama_optional():pytest.importorskip("ollama")import ollamaresponse = ollama.chat(model="llama3.2:latest",messages=[{"role": "user", "content": "Say hello in one sentence."}])assert 'message' in responsedef test_hf_login_optional():pytest.importorskip("huggingface_hub")from huggingface_hub import whoamiuser = whoami()assert 'name' in user
test_setup.py+28-20