Text Generation
Transformers
Safetensors
GGUF
Korean
English
llama
3b
korean
from-scratch
orpo
instruction-tuned
preference-aligned
fp8
b200
Eval Results (legacy)
text-generation-inference
Instructions to use pathcosmos/frankenstallm with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use pathcosmos/frankenstallm with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="pathcosmos/frankenstallm")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("pathcosmos/frankenstallm") model = AutoModelForCausalLM.from_pretrained("pathcosmos/frankenstallm", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use pathcosmos/frankenstallm 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 pathcosmos/frankenstallm:Q4_K_M # Run inference directly in the terminal: llama cli -hf pathcosmos/frankenstallm:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf pathcosmos/frankenstallm:Q4_K_M # Run inference directly in the terminal: llama cli -hf pathcosmos/frankenstallm:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf pathcosmos/frankenstallm:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf pathcosmos/frankenstallm:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf pathcosmos/frankenstallm:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf pathcosmos/frankenstallm:Q4_K_M
Use Docker
docker model run hf.co/pathcosmos/frankenstallm:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use pathcosmos/frankenstallm with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "pathcosmos/frankenstallm" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "pathcosmos/frankenstallm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/pathcosmos/frankenstallm:Q4_K_M
- SGLang
How to use pathcosmos/frankenstallm with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "pathcosmos/frankenstallm" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "pathcosmos/frankenstallm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "pathcosmos/frankenstallm" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "pathcosmos/frankenstallm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use pathcosmos/frankenstallm with Ollama:
ollama run hf.co/pathcosmos/frankenstallm:Q4_K_M
- Unsloth Studio
How to use pathcosmos/frankenstallm with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for pathcosmos/frankenstallm to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for pathcosmos/frankenstallm to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for pathcosmos/frankenstallm to start chatting
- Docker Model Runner
How to use pathcosmos/frankenstallm with Docker Model Runner:
docker model run hf.co/pathcosmos/frankenstallm:Q4_K_M
- Lemonade
How to use pathcosmos/frankenstallm with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull pathcosmos/frankenstallm:Q4_K_M
Run and chat with the model
lemonade run user.frankenstallm-Q4_K_M
List all available models
lemonade list
- Atomic Chat
| # ============================================================ | |
| # run_eval_quick.sh β λΉ λ₯Έ νκ° μ²΄ν¬ (λͺ©ν: 20-30λΆ) | |
| # | |
| # μ¬μ©λ²: | |
| # bash scripts/run_eval_quick.sh [CHECKPOINT_DIR] [OUTPUT_DIR] | |
| # | |
| # μμ: | |
| # bash scripts/run_eval_quick.sh \ | |
| # checkpoints/korean_1b_sft/checkpoint-0005000 \ | |
| # eval/outputs/quick_5000 | |
| # | |
| # νμ€ν¬: kobest_boolq, kobest_copa, haerae_general_knowledge, | |
| # haerae_history, paws_ko | |
| # ============================================================ | |
| set -euo pipefail | |
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |
| PROJECT_DIR="$(dirname "$SCRIPT_DIR")" | |
| # βββ μΈμ μ²λ¦¬ ββββββββββββββββββββββββββββββββββββββββββββ | |
| CHECKPOINT="${1:-checkpoints/korean_1b_sft/checkpoint-0005000}" | |
| TIMESTAMP="$(date +%Y%m%d_%H%M%S)" | |
| OUTPUT_DIR="${2:-eval/outputs/quick_${TIMESTAMP}}" | |
| # μλ κ²½λ‘ β μ λ κ²½λ‘ | |
| [[ "$CHECKPOINT" != /* ]] && CHECKPOINT="$PROJECT_DIR/$CHECKPOINT" | |
| [[ "$OUTPUT_DIR" != /* ]] && OUTPUT_DIR="$PROJECT_DIR/$OUTPUT_DIR" | |
| # βββ μ€μ ββββββββββββββββββββββββββββββββββββββββββββββββ | |
| HF_MODEL_DIR="$PROJECT_DIR/outputs/hf_$(basename "$CHECKPOINT")" | |
| TOKENIZER="$PROJECT_DIR/tokenizer/korean_sp/tokenizer.json" | |
| DEVICE="${CUDA_VISIBLE_DEVICES:-0}" # κΈ°λ³Έ: GPU 0λ²λ§ μ¬μ© | |
| BATCH_SIZE="auto" | |
| # λΉ λ₯Έ μ²΄ν¬ νμ€ν¬ (μ½ 2,000 μν, ~20λΆ) | |
| TASKS="kobest_boolq,kobest_copa,haerae_general_knowledge,haerae_history,paws_ko" | |
| # βββ μμ‘΄μ± νμΈ βββββββββββββββββββββββββββββββββββββββββ | |
| check_dep() { | |
| python3 -c "import $1" 2>/dev/null || { echo "β $1 not found. pip install $2"; exit 1; } | |
| } | |
| check_dep lm_eval lm-eval | |
| check_dep transformers transformers | |
| check_dep safetensors safetensors | |
| echo "==================================================" | |
| echo " Ko-LLM Quick Eval" | |
| echo "==================================================" | |
| echo " Checkpoint : $CHECKPOINT" | |
| echo " HF output : $HF_MODEL_DIR" | |
| echo " Tasks : $TASKS" | |
| echo " Output : $OUTPUT_DIR" | |
| echo " Device : cuda:$DEVICE" | |
| echo "==================================================" | |
| mkdir -p "$OUTPUT_DIR" | |
| # βββ Step 1: HF ν¬λ§· λ³ν βββββββββββββββββββββββββββββββ | |
| if [ ! -f "$HF_MODEL_DIR/config.json" ]; then | |
| echo "" | |
| echo "βΆ Step 1: 컀μ€ν 체ν¬ν¬μΈνΈ β HF ν¬λ§· λ³ν..." | |
| python3 "$PROJECT_DIR/scripts/convert_to_hf.py" \ | |
| --checkpoint "$CHECKPOINT" \ | |
| --output "$HF_MODEL_DIR" \ | |
| --tokenizer "$TOKENIZER" | |
| echo "β HF λ³ν μλ£: $HF_MODEL_DIR" | |
| else | |
| echo "βΆ Step 1: HF λͺ¨λΈ μ΄λ―Έ μ‘΄μ¬, λ³ν μ€ν΅" | |
| echo " $HF_MODEL_DIR" | |
| fi | |
| # βββ Step 2: lm-eval μ€ν βββββββββββββββββββββββββββββββ | |
| echo "" | |
| echo "βΆ Step 2: lm-eval νκ° μμ..." | |
| START_TIME=$(date +%s) | |
| CUDA_VISIBLE_DEVICES="$DEVICE" python3 -m lm_eval \ | |
| --model hf \ | |
| --model_args "pretrained=$HF_MODEL_DIR,dtype=float16" \ | |
| --tasks "$TASKS" \ | |
| --num_fewshot 0 \ | |
| --batch_size "$BATCH_SIZE" \ | |
| --output_path "$OUTPUT_DIR" \ | |
| --log_samples \ | |
| --verbosity INFO \ | |
| 2>&1 | tee "$OUTPUT_DIR/eval.log" | |
| END_TIME=$(date +%s) | |
| ELAPSED=$(( END_TIME - START_TIME )) | |
| echo "" | |
| echo "==================================================" | |
| echo "β νκ° μλ£!" | |
| echo " μμμκ°: $((ELAPSED / 60))λΆ $((ELAPSED % 60))μ΄" | |
| echo " κ²°κ³Ό μ μ₯: $OUTPUT_DIR" | |
| echo "==================================================" | |
| # βββ Step 3: κ²°κ³Ό μμ½ μΆλ ₯ βββββββββββββββββββββββββββββ | |
| echo "" | |
| echo "βΆ Step 3: κ²°κ³Ό μμ½" | |
| python3 - <<'PYEOF' | |
| import json, glob, sys, os | |
| output_dir = sys.argv[1] if len(sys.argv) > 1 else "." | |
| results_files = glob.glob(f"{output_dir}/**/*.json", recursive=True) | |
| results_files = [f for f in results_files if "results" in f.lower()] | |
| if not results_files: | |
| print("κ²°κ³Ό JSON νμΌ μμ. eval.log νμΈνμΈμ.") | |
| sys.exit(0) | |
| for rf in results_files: | |
| try: | |
| with open(rf) as f: | |
| data = json.load(f) | |
| results = data.get("results", {}) | |
| print(f"\n{'='*50}") | |
| print(f"Task Results (from {os.path.basename(rf)})") | |
| print(f"{'='*50}") | |
| for task, metrics in results.items(): | |
| print(f"\n{task}:") | |
| for key, val in metrics.items(): | |
| if "stderr" not in key and isinstance(val, (int, float)): | |
| print(f" {key}: {val:.4f}") | |
| except Exception as e: | |
| print(f"νμ± μ€ν¨: {rf}: {e}") | |
| PYEOF | |
| python3 - "$OUTPUT_DIR" <<'PYEOF' | |
| import json, glob, sys, os | |
| output_dir = sys.argv[1] if len(sys.argv) > 1 else "." | |
| results_files = glob.glob(f"{output_dir}/**/*.json", recursive=True) | |
| results_files = [f for f in results_files if "results" in os.path.basename(f)] | |
| if not results_files: | |
| # try finding any json | |
| results_files = glob.glob(f"{output_dir}/*.json") | |
| for rf in results_files[:3]: | |
| try: | |
| with open(rf) as f: | |
| data = json.load(f) | |
| results = data.get("results", {}) | |
| print(f"\n{'='*50}\nTask Results: {os.path.basename(rf)}\n{'='*50}") | |
| for task, metrics in results.items(): | |
| print(f"\n{task}:") | |
| for key, val in metrics.items(): | |
| if "stderr" not in key and isinstance(val, (int, float)): | |
| print(f" {key}: {val:.4f}") | |
| except Exception as e: | |
| print(f"νμ± μ€ν¨: {rf}: {e}") | |
| PYEOF | |