Spaces:
Runtime error
Runtime error
flan t5 vs gpt2
Browse files
app.py
CHANGED
@@ -12,20 +12,20 @@ print(f"Is CUDA available: {torch.cuda.is_available()}")
|
|
12 |
print(f"CUDA device: {torch.cuda.get_device_name(torch.cuda.current_device())}")
|
13 |
|
14 |
pipe_biogpt = pipeline("text-generation", model="microsoft/BioGPT-Large", device="cuda:0", model_kwargs={"torch_dtype":torch.bfloat16})
|
15 |
-
|
16 |
-
|
17 |
|
18 |
-
title = "
|
19 |
-
description = "**Disclaimer:** this demo was made for research purposes only
|
20 |
|
21 |
def inference(text):
|
22 |
output_biogpt = pipe_biogpt(text, max_length=100)[0]["generated_text"]
|
23 |
-
|
24 |
-
|
25 |
return [
|
26 |
output_biogpt,
|
27 |
-
|
28 |
-
|
29 |
]
|
30 |
|
31 |
io = gr.Interface(
|
@@ -33,8 +33,8 @@ io = gr.Interface(
|
|
33 |
gr.Textbox(lines=3),
|
34 |
outputs=[
|
35 |
gr.Textbox(lines=3, label="BioGPT-Large"),
|
36 |
-
gr.Textbox(lines=3, label="Flan
|
37 |
-
gr.Textbox(lines=3, label="
|
38 |
],
|
39 |
title=title,
|
40 |
description=description,
|
|
|
12 |
print(f"CUDA device: {torch.cuda.get_device_name(torch.cuda.current_device())}")
|
13 |
|
14 |
pipe_biogpt = pipeline("text-generation", model="microsoft/BioGPT-Large", device="cuda:0", model_kwargs={"torch_dtype":torch.bfloat16})
|
15 |
+
pipe_flan_t5_xxl = pipeline("text-generation", model="google/flan-t5-xxl", device="cuda:0", model_kwargs={"torch_dtype":torch.bfloat16})
|
16 |
+
pipe_gpt_2 = pipeline("text-generation", model="gpt2", device="cuda:0", model_kwargs={"torch_dtype":torch.bfloat16})
|
17 |
|
18 |
+
title = "LLM vs LLM!"
|
19 |
+
description = "**Disclaimer:** this demo was made for research purposes only."
|
20 |
|
21 |
def inference(text):
|
22 |
output_biogpt = pipe_biogpt(text, max_length=100)[0]["generated_text"]
|
23 |
+
output_flan_t5_xxl = pipe_flan_t5_xxl(text, max_length=100)[0]["generated_text"]
|
24 |
+
output_gpt_2 = pipe_gpt_2(text, max_length=100)[0]["generated_text"]
|
25 |
return [
|
26 |
output_biogpt,
|
27 |
+
output_flan_t5_xxl,
|
28 |
+
output_gpt_2
|
29 |
]
|
30 |
|
31 |
io = gr.Interface(
|
|
|
33 |
gr.Textbox(lines=3),
|
34 |
outputs=[
|
35 |
gr.Textbox(lines=3, label="BioGPT-Large"),
|
36 |
+
gr.Textbox(lines=3, label="Flan T5 XXL"),
|
37 |
+
gr.Textbox(lines=3, label="GPT-2"),
|
38 |
],
|
39 |
title=title,
|
40 |
description=description,
|