Instructions to use macadeliccc/gemma-2b-pubmed-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use macadeliccc/gemma-2b-pubmed-classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="macadeliccc/gemma-2b-pubmed-classifier")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("macadeliccc/gemma-2b-pubmed-classifier") model = AutoModelForCausalLM.from_pretrained("macadeliccc/gemma-2b-pubmed-classifier") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use macadeliccc/gemma-2b-pubmed-classifier with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "macadeliccc/gemma-2b-pubmed-classifier" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "macadeliccc/gemma-2b-pubmed-classifier", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/macadeliccc/gemma-2b-pubmed-classifier
- SGLang
How to use macadeliccc/gemma-2b-pubmed-classifier 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 "macadeliccc/gemma-2b-pubmed-classifier" \ --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": "macadeliccc/gemma-2b-pubmed-classifier", "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 "macadeliccc/gemma-2b-pubmed-classifier" \ --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": "macadeliccc/gemma-2b-pubmed-classifier", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use macadeliccc/gemma-2b-pubmed-classifier with Docker Model Runner:
docker model run hf.co/macadeliccc/gemma-2b-pubmed-classifier
This lora was made for educational purposes as part of an upcoming series. The model returns a series of classifications in CSV. More information will be released 7/1
I make no claims about medical accuracy.
Trained on owaiskha9654/PubMed_MultiLabel_Text_Classification_Dataset_MeSH
Prompt Template:
<|im_start|>system
{system}<|im_end|>
<|im_start|>user
{user}<|im_end|>
<|im_start|>assistant
Example Usage
System: Given the title and abstract of a medical research paper, classify it into the most relevant MeSH (Medical Subject Headings) major terms.
Input: Title: Expression of p53 and coexistence of HPV in premalignant lesions and in cervical cancer. \n Abstract: Fifty-four paraffin embedded tissue sections from patients with dysplasia (21 cases) and with cervical cancer (33 cases) were analysed. HPV was detected and identified in two stages. Firstly, using mixed starters, chosen genomic DNA sequences were amplified; secondly the material thus obtained was analyzed by hybridization method using oligonucleotyde 31-P labelled probe. HPVs of type 6, 11, 16, 18, 33 were identified.
Output: Cervical Intraepithelial Neoplasia, DNA, Viral, Female, Humans, Precancerous Conditions, Tumor Suppressor Protein p53, Viral Load, Virology
- Downloads last month
- 7
Model tree for macadeliccc/gemma-2b-pubmed-classifier
Base model
google/gemma-2b
docker model run hf.co/macadeliccc/gemma-2b-pubmed-classifier