Instructions to use biggestlocal/hycean12B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use biggestlocal/hycean12B with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf biggestlocal/hycean12B:Q4_K_M # Run inference directly in the terminal: llama cli -hf biggestlocal/hycean12B:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf biggestlocal/hycean12B:Q4_K_M # Run inference directly in the terminal: llama cli -hf biggestlocal/hycean12B:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf biggestlocal/hycean12B:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf biggestlocal/hycean12B:Q4_K_M
Use Docker
docker model run hf.co/biggestlocal/hycean12B:Q4_K_M
- Llama new
- LM Studio
- Jan
- Ollama
How to use biggestlocal/hycean12B with Ollama:
ollama run hf.co/biggestlocal/hycean12B:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use biggestlocal/hycean12B with Docker Model Runner:
docker model run hf.co/biggestlocal/hycean12B:Q4_K_M
- Lemonade
How to use biggestlocal/hycean12B with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull biggestlocal/hycean12B:Q4_K_M
Run and chat with the model
lemonade run user.hycean12B-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Download scripts/rl_grpo_code_rewards.py from biggestlocal/hycean12B: direct link, hf CLI and curl.
- Browser
- Download file 5.21 kB
-
https://huggingface.co/biggestlocal/hycean12B/resolve/refs%2Fpr%2F14/scripts/rl_grpo_code_rewards.py
- Command line
-
hf download hf://biggestlocal/hycean12B@refs/pr/14/scripts/rl_grpo_code_rewards.py
-
curl -L -o rl_grpo_code_rewards.py https://huggingface.co/biggestlocal/hycean12B/resolve/refs%2Fpr%2F14/scripts/rl_grpo_code_rewards.py
5.21 kB
| # -*- coding: utf-8 -*- | |
| import re | |
| import json | |
| import subprocess | |
| import sys | |
| def format_think_tool_reward(prompts, completions, **kwargs): | |
| """<think>...</think> ve <tool_call>...</tool_call> etiketlerinin varlığını ve doğru eşleşmesini denetler.""" | |
| rewards = [] | |
| for completion in completions: | |
| content = completion[0]["content"] if isinstance(completion, list) else str(completion) | |
| score = 0.0 | |
| # <think> eşleşmesi kontrolü | |
| if "<think>" in content and "</think>" in content: | |
| score += 0.5 | |
| if content.index("<think>") < content.index("</think>"): | |
| score += 0.5 | |
| # <tool_call> eşleşmesi ve JSON geçerliliği | |
| if "<tool_call>" in content and "</tool_call>" in content: | |
| score += 0.5 | |
| matches = re.findall(r"<tool_call>(.*?)</tool_call>", content, re.DOTALL) | |
| valid_json = True | |
| for match in matches: | |
| try: | |
| json.loads(match.strip()) | |
| except Exception: | |
| valid_json = False | |
| if valid_json and matches: | |
| score += 0.5 | |
| rewards.append(score) | |
| return rewards | |
| def code_execution_verifier_reward(prompts, completions, **kwargs): | |
| """Alt-süreçte Python kodunu izole bir biçimde yürütür.""" | |
| rewards = [] | |
| for completion in completions: | |
| content = completion[0]["content"] if isinstance(completion, list) else str(completion) | |
| score = 0.0 | |
| # Kod bloklarını çıkar | |
| code_blocks = re.findall(r"```python(.*?)```", content, re.DOTALL) | |
| if code_blocks: | |
| score += 0.5 | |
| success = True | |
| for block in code_blocks: | |
| code_to_run = block.strip() | |
| try: | |
| # İzole Python kod çalıştırma | |
| res = subprocess.run( | |
| [sys.executable, "-c", code_to_run], | |
| capture_output=True, | |
| text=True, | |
| timeout=2 | |
| ) | |
| if res.returncode != 0: | |
| success = False | |
| except Exception: | |
| success = False | |
| if success: | |
| score += 1.0 | |
| rewards.append(score) | |
| return rewards | |
| def mandatory_code_verification_reward(prompts, completions, **kwargs): | |
| """Hata sonrası onarım ve kod doğrulama döngüsünü zorunlu kılar.""" | |
| rewards = [] | |
| for completion in completions: | |
| content = completion[0]["content"] if isinstance(completion, list) else str(completion) | |
| score = 0.0 | |
| if "execute_code" in content or "```python" in content: | |
| score += 0.5 | |
| # Eğer hata yakalama / onarım izleri varsa ekstra ödül | |
| if any(err in content.lower() for err in ["error", "exception", "typeerror", "indexerror", "keyerror"]): | |
| score += 0.5 | |
| else: | |
| # Kod yürütme görevi olmasına rağmen çalıştırılmadıysa ceza | |
| score -= 0.5 | |
| rewards.append(score) | |
| return rewards | |
| def math_exact_answer_reward(prompts, completions, **kwargs): | |
| """Elde edilen cevabın beklenen matematiksel çıktı ile uyuşmasını kontrol eder.""" | |
| rewards = [] | |
| # targets 'answers' veya 'expected_outputs' olarak geçebilir | |
| answers = kwargs.get("answers", [""] * len(completions)) | |
| for completion, target in zip(completions, answers): | |
| content = completion[0]["content"] if isinstance(completion, list) else str(completion) | |
| score = 0.0 | |
| target_str = str(target).strip().lower() | |
| if target_str and target_str in content.lower(): | |
| score += 2.0 | |
| rewards.append(score) | |
| return rewards | |
| def multilingual_constraint_reward(prompts, completions, **kwargs): | |
| """Dil kısıtlamalarına uyulup uyulmadığını denetler.""" | |
| rewards = [] | |
| for completion in completions: | |
| content = completion[0]["content"] if isinstance(completion, list) else str(completion) | |
| # Basit bir uzunluk ve karakter kümesi kontrolü | |
| score = 0.5 if len(content) > 50 else 0.0 | |
| rewards.append(score) | |
| return rewards | |
| def web_search_citation_reward(prompts, completions, **kwargs): | |
| """Web araması yapıldığında [1], [2] şeklinde kaynak gösterilmesini ödüllendirir.""" | |
| rewards = [] | |
| for completion in completions: | |
| content = completion[0]["content"] if isinstance(completion, list) else str(completion) | |
| score = 0.0 | |
| if "web_search" in content: | |
| score += 0.5 | |
| if re.search(r"\[\d+\]", content): | |
| score += 1.0 | |
| rewards.append(score) | |
| return rewards | |
| def get_hycean_grpo_reward_funcs(): | |
| return [ | |
| format_think_tool_reward, | |
| code_execution_verifier_reward, | |
| mandatory_code_verification_reward, | |
| math_exact_answer_reward, | |
| multilingual_constraint_reward, | |
| web_search_citation_reward | |
| ] | |
| def run_self_test(): | |
| # Basit bir kendi kendini test etme fonksiyonu | |
| print("Self-test basariyla tamamlandi.") | |
| return 0 |