Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to run model and finetune it. #98

Open
nageshpindi opened this issue May 10, 2023 · 1 comment
Open

How to run model and finetune it. #98

nageshpindi opened this issue May 10, 2023 · 1 comment

Comments

@nageshpindi
Copy link

Hi Guys,
I need to know how to load the BioGPT model and run it. BioGPT exactly matches with my requirement and i was in searching online but i could't find any useful resources. Can you please help me on this model, Thanks in advanced.

@ksooklall
Copy link

Have you tired using the huggingface code in the home page?

from transformers import pipeline, set_seed
from transformers import BioGptTokenizer, BioGptForCausalLM
model = BioGptForCausalLM.from_pretrained("microsoft/biogpt-large") # remove large if the model is too big
tokenizer = BioGptTokenizer.from_pretrained("microsoft/biogpt-large")
generator = pipeline('text-generation', model=model, tokenizer=tokenizer)
set_seed(42)

query = 'A patient with an inner ear infection should take antibiotic'

result = generator(query, max_length=300, num_return_sequences=2, do_sample=True)
print(result
```)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants