模型:
chaoyi-wu/MedLLaMA_13B
这个仓库包含了MedLLaMA_13B,它是使用一些医学语料库对LLaMA-13b进行微调的模型。
该模型使用以下超参数进行训练:
可以使用以下方式加载模型:
import transformers import torch tokenizer = transformers.LlamaTokenizer.from_pretrained('chaoyi-wu/MedLLaMA_13B') model = transformers.LlamaForCausalLM.from_pretrained('chaoyi-wu/MedLLaMA_13B') sentence = 'Hello, doctor' batch = tokenizer( sentence, return_tensors="pt", add_special_tokens=False ) with torch.no_grad(): generated = model.generate(inputs = batch["input_ids"], max_length=200, do_sample=True, top_k=50) print('model predict: ',tokenizer.decode(generated[0]))