Instructions to use WENGSYX/MedCPT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use WENGSYX/MedCPT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="WENGSYX/MedCPT")# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("WENGSYX/MedCPT") model = AutoModel.from_pretrained("WENGSYX/MedCPT") - Notebooks
- Google Colab
- Kaggle
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
MedCPT
LingYi system pre training medical model
Prease load the model from CPT
Usage
>>> from modeling_cpt import CPTForConditionalGeneration
>>> from transformers import BertTokenizer
>>> tokenizer = BertTokenizer.from_pretrained("WENGSYX/MedCPT")
>>> model = CPTForConditionalGeneration.from_pretrained("WENGSYX/MedCPT")
>>> inputs = tokenizer.encode("医生你好,腹泻难受应该怎么办?", return_tensors='pt')
>>> pred_ids = model.generate(input_ids, num_beams=4, max_length=20)
>>> print(tokenizer.convert_ids_to_tokens(pred_ids[i]))
- Downloads last month
- 8