Instructions to use SURESHBEEKHANI/Gemma_2B_Medical_ORPO_RLHF_Fine_Tuning with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use SURESHBEEKHANI/Gemma_2B_Medical_ORPO_RLHF_Fine_Tuning with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="SURESHBEEKHANI/Gemma_2B_Medical_ORPO_RLHF_Fine_Tuning", filename="unsloth.Q4_K_M.gguf", )
llm.create_chat_completion( messages = "{\n \"question\": \"What is my name?\",\n \"context\": \"My name is Clara and I live in Berkeley.\"\n}" ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use SURESHBEEKHANI/Gemma_2B_Medical_ORPO_RLHF_Fine_Tuning 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 SURESHBEEKHANI/Gemma_2B_Medical_ORPO_RLHF_Fine_Tuning:Q4_K_M # Run inference directly in the terminal: llama cli -hf SURESHBEEKHANI/Gemma_2B_Medical_ORPO_RLHF_Fine_Tuning:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf SURESHBEEKHANI/Gemma_2B_Medical_ORPO_RLHF_Fine_Tuning:Q4_K_M # Run inference directly in the terminal: llama cli -hf SURESHBEEKHANI/Gemma_2B_Medical_ORPO_RLHF_Fine_Tuning: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 SURESHBEEKHANI/Gemma_2B_Medical_ORPO_RLHF_Fine_Tuning:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf SURESHBEEKHANI/Gemma_2B_Medical_ORPO_RLHF_Fine_Tuning: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 SURESHBEEKHANI/Gemma_2B_Medical_ORPO_RLHF_Fine_Tuning:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf SURESHBEEKHANI/Gemma_2B_Medical_ORPO_RLHF_Fine_Tuning:Q4_K_M
Use Docker
docker model run hf.co/SURESHBEEKHANI/Gemma_2B_Medical_ORPO_RLHF_Fine_Tuning:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use SURESHBEEKHANI/Gemma_2B_Medical_ORPO_RLHF_Fine_Tuning with Ollama:
ollama run hf.co/SURESHBEEKHANI/Gemma_2B_Medical_ORPO_RLHF_Fine_Tuning:Q4_K_M
- Unsloth Studio
How to use SURESHBEEKHANI/Gemma_2B_Medical_ORPO_RLHF_Fine_Tuning 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 SURESHBEEKHANI/Gemma_2B_Medical_ORPO_RLHF_Fine_Tuning 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 SURESHBEEKHANI/Gemma_2B_Medical_ORPO_RLHF_Fine_Tuning to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for SURESHBEEKHANI/Gemma_2B_Medical_ORPO_RLHF_Fine_Tuning to start chatting
- Atomic Chat new
- Docker Model Runner
How to use SURESHBEEKHANI/Gemma_2B_Medical_ORPO_RLHF_Fine_Tuning with Docker Model Runner:
docker model run hf.co/SURESHBEEKHANI/Gemma_2B_Medical_ORPO_RLHF_Fine_Tuning:Q4_K_M
- Lemonade
How to use SURESHBEEKHANI/Gemma_2B_Medical_ORPO_RLHF_Fine_Tuning with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull SURESHBEEKHANI/Gemma_2B_Medical_ORPO_RLHF_Fine_Tuning:Q4_K_M
Run and chat with the model
lemonade run user.Gemma_2B_Medical_ORPO_RLHF_Fine_Tuning-Q4_K_M
List all available models
lemonade list
Model Card: Gemma 2B Medical ORPO RLHF Fine-Tuning
Model Overview
- Model Name: Gemma 2B Medical ORPO RLHF Fine-Tuning
- Repository: SURESHBEEKHANI/Gemma_2B_Medical_ORPO_RLHF_Fine_Tuning
- Base Model: unsloth/gemma-2b-bnb-4bit
- Fine-Tuning Method: ORPO RLHF (Reinforcement Learning with Human Feedback)
Model Description
This model is a fine-tuned version of the Gemma 2B model using ORPO RLHF to enhance its medical reasoning capabilities. The fine-tuning process leverages a medical-reasoning dataset to improve decision-making and contextual understanding in healthcare-related queries.
Intended Use
This model is designed for:
- Assisting in medical reasoning and diagnosis
- Enhancing clinical decision support
- Providing explanations for medical queries
- Research and educational purposes in the medical field
Limitations:
- Not a substitute for professional medical advice.
- May contain biases based on the dataset.
- Performance is dependent on prompt formulation.
Training Details
- Dataset Used: SURESHBEEKHANI/medical-reasoning-orpo
- Number of Training Steps: 30 (Demo setting, increase for full training)
- Batch Size: 1 per device
- Gradient Accumulation Steps: 4
- Optimizer: AdamW (8-bit)
- Learning Rate Scheduler: Linear
- Precision: Mixed (Bfloat16 or Float16 depending on hardware)
- Quantization: 4-bit (q4_k_m, q8_0, q5_k_m)
Model Performance
The model was evaluated based on:
- Accuracy in medical reasoning tasks
- Fluency in response generation
- Coherence and factual correctness
- Comparison with baseline medical AI models
Ethical Considerations
- The model should not be used for making actual medical decisions without professional oversight.
- Potential biases in medical datasets may lead to inaccurate or misleading outputs.
- Always verify responses with medical professionals before acting on them.
How to Use
from unsloth import FastLanguageModel
from transformers import AutoTokenizer
model, tokenizer = FastLanguageModel.from_pretrained(
"SURESHBEEKHANI/Gemma_2B_Medical_ORPO_RLHF_Fine_Tuning",
load_in_4bit=True
)
prompt = "### Instruction: Diagnose the following symptoms...\n### Input: Fever, headache, and rash\n### Response:"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
Citation
If you use this model, please cite:
@misc{gemma2b_orpo_medical,
author = {Suresh Beekhanii},
title = {Fine-Tuning Gemma 2B for Medical Reasoning using ORPO RLHF},
year = {2024},
publisher = {Hugging Face},
url = {https://huggingface.co/SURESHBEEKHANI/Gemma_2B_Medical_ORPO_RLHF_Fine_Tuning}
}
Contact
For any issues or questions, please contact Suresh Beekhanii or open an issue in the Hugging Face repository.
- Downloads last month
- 30
4-bit
5-bit
8-bit
Model tree for SURESHBEEKHANI/Gemma_2B_Medical_ORPO_RLHF_Fine_Tuning
Base model
unsloth/gemma-2b-bnb-4bit