Spaces:
Sleeping
Sleeping
diogocarapito
commited on
Commit
•
3aa5fd9
1
Parent(s):
51676b0
small changes
Browse files
app.py
CHANGED
@@ -2,12 +2,14 @@ import gradio as gr
|
|
2 |
from transformers import pipeline, set_seed
|
3 |
from transformers import BioGptTokenizer, BioGptForCausalLM
|
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
def biogpt_promot(inpt):
|
6 |
-
|
7 |
-
tokenizer = BioGptTokenizer.from_pretrained("microsoft/biogpt")
|
8 |
-
generator = pipeline('text-generation', model=model, tokenizer=tokenizer)
|
9 |
-
set_seed(42)
|
10 |
-
return generator("COVID-19 is", max_length=20, num_return_sequences=5, do_sample=True)
|
11 |
|
12 |
|
13 |
#def hello(name):
|
|
|
2 |
from transformers import pipeline, set_seed
|
3 |
from transformers import BioGptTokenizer, BioGptForCausalLM
|
4 |
|
5 |
+
|
6 |
+
model = BioGptForCausalLM.from_pretrained("microsoft/biogpt")
|
7 |
+
tokenizer = BioGptTokenizer.from_pretrained("microsoft/biogpt")
|
8 |
+
generator = pipeline('text-generation', model=model, tokenizer=tokenizer)
|
9 |
+
set_seed(42)
|
10 |
+
|
11 |
def biogpt_promot(inpt):
|
12 |
+
return generator(inpt, max_length=20, num_return_sequences=5, do_sample=True)
|
|
|
|
|
|
|
|
|
13 |
|
14 |
|
15 |
#def hello(name):
|