Instructions to use hara-CU/gemma9b-FT-Candidate241214-1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hara-CU/gemma9b-FT-Candidate241214-1 with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("hara-CU/gemma9b-FT-Candidate241214-1", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- Unsloth Studio new
How to use hara-CU/gemma9b-FT-Candidate241214-1 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 hara-CU/gemma9b-FT-Candidate241214-1 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 hara-CU/gemma9b-FT-Candidate241214-1 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for hara-CU/gemma9b-FT-Candidate241214-1 to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="hara-CU/gemma9b-FT-Candidate241214-1", max_seq_length=2048, )
###推論方法
model_id = "hara-CU/gemma9b-FT-Candidate241214-1"
dtype = None
load_in_4bit = True
model, tokenizer = FastLanguageModel.from_pretrained( model_name=model_id, dtype=dtype, load_in_4bit=load_in_4bit, trust_remote_code=True, ) FastLanguageModel.for_inference(model)
datasets ="file_path1" #データセットの読み込み
results = []
for dt in tqdm(datasets):
input = dt["input"]
prompt = f"""### 指示\n{input}\n### 回答\n"""
inputs = tokenizer([prompt], return_tensors = "pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens = 700, use_cache = True, do_sample=False, repetition_penalty=1.2) prediction = tokenizer.decode(outputs[0], skip_special_tokens=True).split('\n### 回答')[-1]
results.append({"task_id": dt["task_id"], "input": input, "output": prediction})
json_file="file_path2"
with open(json_file, 'w', encoding='utf-8') as f: for result in results: json.dump(result, f, ensure_ascii=False) f.write('\n')
Uploaded model
##使用データセット
weblab-GENIAC/aya-ja-evol-instruct-calm3-dpo-masked
DeL-TaiseiOzaki/Tengentoppa-sft-reasoning-ja
- Developed by: hara-CU
- License: Gemma Terms of Use
- Finetuned from model : hara-CU/gemma-2-9b-Quant-4bit-base
This gemma2 model was trained 2x faster with Unsloth and Huggingface's TRL library.
Model tree for hara-CU/gemma9b-FT-Candidate241214-1
Base model
hara-CU/gemma-2-9b-Quant-4bit-base