hf_mirrors/gemma-ko-v01
Model Introduction
Files & versions
Analysis
You are visiting the mirror address of https://modelers.cn/SY_AICC/gemma-ko-v01. The repo is synchronized in real-time and is only for mirror acceleration access.

Modification

  • Modify examples and add npu support;
  • Modify dependencies;

Code Usage(core part)

import argparse
import torch
from openmind import pipeline, is_torch_npu_available
from openmind_hub import snapshot_download

if is_torch_npu_available():
    device = "npu:0"
  else:
    device = "cpu"
  generate_text = pipeline(
   model="SY_AICC/gemma-ko-v01",
   torch_dtype=torch.bfloat16, 
   trust_remote_code=True,
   device=device,
  )
  output = generate_text(
   "Why is drinking water so healthy?",
   max_new_tokens=100
  )
  print(output[0]["generated_text"])