Spaces:
Sleeping
Sleeping
abhishekmamdapure
commited on
Commit
•
e04a26e
1
Parent(s):
8793682
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,13 @@ model = BioGptForCausalLM.from_pretrained("microsoft/biogpt")
|
|
5 |
tokenizer = BioGptTokenizer.from_pretrained("microsoft/biogpt")
|
6 |
generator = pipeline('text-generation', model=model, tokenizer=tokenizer)
|
7 |
set_seed(42)
|
|
|
|
|
8 |
def predict(text):
|
9 |
return generator(text, max_length=20, num_return_sequences=1, do_sample=True)
|
|
|
|
|
10 |
interface = gr.Interface(predict, "textbox", "textbox", title="Biogpt", description="Biogpt")
|
|
|
|
|
11 |
interface.launch()
|
|
|
5 |
tokenizer = BioGptTokenizer.from_pretrained("microsoft/biogpt")
|
6 |
generator = pipeline('text-generation', model=model, tokenizer=tokenizer)
|
7 |
set_seed(42)
|
8 |
+
|
9 |
+
|
10 |
def predict(text):
|
11 |
return generator(text, max_length=20, num_return_sequences=1, do_sample=True)
|
12 |
+
|
13 |
+
|
14 |
interface = gr.Interface(predict, "textbox", "textbox", title="Biogpt", description="Biogpt")
|
15 |
+
|
16 |
+
|
17 |
interface.launch()
|