Instructions to use toiru99/agri-31b-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use toiru99/agri-31b-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="toiru99/agri-31b-v1") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("toiru99/agri-31b-v1") model = AutoModelForMultimodalLM.from_pretrained("toiru99/agri-31b-v1", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use toiru99/agri-31b-v1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "toiru99/agri-31b-v1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "toiru99/agri-31b-v1", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/toiru99/agri-31b-v1
- SGLang
How to use toiru99/agri-31b-v1 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 "toiru99/agri-31b-v1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "toiru99/agri-31b-v1", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "toiru99/agri-31b-v1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "toiru99/agri-31b-v1", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use toiru99/agri-31b-v1 with Docker Model Runner:
docker model run hf.co/toiru99/agri-31b-v1
agri-31b-v1
농업 분야 한국어 대화를 위해 LoRA 파인튜닝한 31B 모델의 BF16 병합 가중치입니다. 별도 어댑터 없이 로드할 수 있습니다.
공개 실험용 체크포인트입니다. 학습 데이터의 일부 의미 검수와 최종 admission은 완료되지 않았습니다.
학습
LoRA r=16, alpha=32, learning rate 2e-5, seed 42, 유효 배치 16, 최대 길이 16,384토큰으로 학습했습니다. 가중치 업데이트 100 step이며, 3,918행 기준 약 0.408 epoch입니다.
기존 어댑터 평가 기록
| AgBench v7 전체 200문항 | 정답 수 | 정확도 |
|---|---|---|
| 과거 단일 최고 기록 | 177/200 | 88.5% |
| 최근 반복 평가 1 | 169/200 | 84.5% |
| 최근 반복 평가 2 | 173/200 | 86.5% |
| 최근 반복 평가 3 | 171/200 | 85.5% |
| 최근 3회 평균 | 171/200 | 85.5% |
위 수치는 BF16 기반 모델 + LoRA 어댑터에서 측정한 기록입니다. 이 배포 병합본의 점수로 측정된 결과가 아닙니다. 추론 상한 4,096토큰, 최종 답변 상한 1,024토큰, temperature 0, seed 42 조건입니다. 같은 벤치마크를 개발 중 반복 사용했으며 독립 미사용 평가셋 성능이 아닙니다. 정답은 전문가 검증 미완료 상태이며 exact-set으로 채점했습니다.
실행
vllm serve toiru99/agri-31b-v1 --max-model-len 16384 \
--enable-auto-tool-choice --tool-call-parser gemma4 --reasoning-parser gemma4
라이선스
Apache License 2.0. 원본 저작자·기반 모델·변경 내역은 NOTICE, 라이선스 전문은 LICENSE에 있습니다.
- Downloads last month
- 35