Run this model with HF Jobs
Run microsoft/biogpt on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/microsoft/biogpt. Ask me which dataset to train on, then push the LoRA adapter to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs and Transformers to run batch inference with https://huggingface.co/microsoft/biogpt on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the predictions back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs and Lighteval to evaluate https://huggingface.co/microsoft/biogpt. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/microsoft/biogpt with Transformers and bitsandbytes. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use microsoft/biogpt with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use microsoft/biogpt with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="microsoft/biogpt")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("microsoft/biogpt") model = AutoModelForCausalLM.from_pretrained("microsoft/biogpt", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use microsoft/biogpt with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "microsoft/biogpt" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "microsoft/biogpt", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/microsoft/biogpt
- SGLang
How to use microsoft/biogpt 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 "microsoft/biogpt" \ --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": "microsoft/biogpt", "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 "microsoft/biogpt" \ --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": "microsoft/biogpt", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use microsoft/biogpt with Docker Model Runner:
docker model run hf.co/microsoft/biogpt
First-pass at putting current summary in Model Card format
Browse filesThis takes the writing that was already here and organizes it into the Model Card protocol.
Still more work to do, but it makes information about the model more easily findable.
1 unmodified line234567891011121349 unmodified lines63646566676814 unmodified lines838485861 unmodified linelanguage: enlicense: mitwidget:- text: "COVID-19 is"---## BioGPTPre-trained language models have attracted increasing attention in the biomedical domain, inspired by their great success in the general natural language domain. Among the two main branches of pre-trained language models in the general language domain, i.e. BERT (and its variants) and GPT (and its variants), the first one has been extensively studied in the biomedical domain, such as BioBERT and PubMedBERT. While they have achieved great success on a variety of discriminative downstream biomedical tasks, the lack of generation ability constrains their application scope. In this paper, we propose BioGPT, a domain-specific generative Transformer language model pre-trained on large-scale biomedical literature. We evaluate BioGPT on six biomedical natural language processing tasks and demonstrate that our model outperforms previous models on most tasks. Especially, we get 44.98%, 38.42% and 40.76% F1 score on BC5CDR, KD-DTI and DDI end-to-end relation extraction tasks, respectively, and 78.2% accuracy on PubMedQA, creating a new record. Our case study on text generation further demonstrates the advantage of BioGPT on biomedical literature to generate fluent descriptions for biomedical terms.You can use this model directly with a pipeline for text generation. Since the generation relies on some randomness, weset a seed for reproducibility:49 unmodified lines'COVID-19 is a global pandemic caused by severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2), the causative agent of coronavirus disease 2019 (COVID-19), which has spread to more than 200 countries and territories, including the United States (US), Canada, Australia, New Zealand, the United Kingdom (UK), and the United States of America (USA), as of March 11, 2020, with more than 800,000 confirmed cases and more than 800,000 deaths.'```## CitationIf you find BioGPT useful in your research, please cite the following paper:14 unmodified linesnote = {bbac409},eprint = {https://academic.oup.com/bib/article-pdf/23/6/bbac409/47144271/bbac409.pdf},}```1 unmodified line23456789101112131415161718192021222324252627282930313249 unmodified lines82838485868788899091929394959697989910010110210310410510610710810911011111211311411511611714 unmodified lines1321331341351 unmodified linelanguage: enlicense: mitwidget:- text: COVID-19 ismetrics:- accuracy- f1---# Model Card for BioGPTBioGPT is a domain-specific generative Transformer language model pre-trained on large-scale biomedical literature.## Model Details### Model DescriptionPre-trained language models have attracted increasing attention in the biomedical domain,inspired by their great success in the general natural language domain.Among the two main branches of pre-trained language models in the general language domain,i.e., BERT (and its variants) and GPT (and its variants), the first one has been extensively studied in the biomedical domain,such as BioBERT and PubMedBERT. While they have achieved great success on a variety of discriminative downstream biomedical tasks,the lack of generation ability constrains their application scope.BioGPT addresses the need for generation abilities, implemented as a domain-specific generative Transformer language modelpre-trained on large-scale biomedical literature.### How to Get Started with the ModelYou can use this model directly with a pipeline for text generation. Since the generation relies on some randomness, weset a seed for reproducibility:49 unmodified lines'COVID-19 is a global pandemic caused by severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2), the causative agent of coronavirus disease 2019 (COVID-19), which has spread to more than 200 countries and territories, including the United States (US), Canada, Australia, New Zealand, the United Kingdom (UK), and the United States of America (USA), as of March 11, 2020, with more than 800,000 confirmed cases and more than 800,000 deaths.'```## Evaluation### Testing Data, Factors & Metrics#### Testing Data<!-- This should link to a Data Card if possible. -->Six biomedical natural language processing tasks.#### Metrics<!-- These are the evaluation metrics being used, ideally with a description of why. -->- F1, for end-to-end relation extraction tasks- Accuracy, on PubMedQA### ResultsThe model achieves 44.98%, 38.42% and 40.76% F1 score on BC5CDR, KD-DTI and DDI end-to-end relation extraction tasks,respectively, and 78.2% accuracy on PubMedQA, creating a new record.#### SummaryThis model outperforms previous models on most evaluated tasks.Our case study on text generation further demonstrates the advantage of BioGPT on biomedical literature togenerate fluent descriptions for biomedical terms.## CitationIf you find BioGPT useful in your research, please cite the following paper:14 unmodified linesnote = {bbac409},eprint = {https://academic.oup.com/bib/article-pdf/23/6/bbac409/47144271/bbac409.pdf},}```
README.md+53-4