Spaces:
Sleeping
Sleeping
-- update for president-gpt2
Browse files
app.py
CHANGED
@@ -2,7 +2,7 @@ import gradio as gr
|
|
2 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
3 |
import torch
|
4 |
|
5 |
-
model_name = "adarksky/
|
6 |
model = AutoModelForCausalLM.from_pretrained(model_name)
|
7 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
8 |
tokenizer.pad_token = tokenizer.eos_token
|
@@ -40,7 +40,7 @@ demo = gr.ChatInterface(
|
|
40 |
additional_inputs=[
|
41 |
gr.Slider(minimum=50, maximum=150, value=100, step=1, label="Min length"),
|
42 |
gr.Slider(minimum=200, maximum=500, value=250, step=1, label="Max length"),
|
43 |
-
gr.Slider(minimum=
|
44 |
gr.Slider(minimum=1, maximum=100, value=50, step=1, label="Top-k"),
|
45 |
],
|
46 |
)
|
|
|
2 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
3 |
import torch
|
4 |
|
5 |
+
model_name = "adarksky/president-gpt2"
|
6 |
model = AutoModelForCausalLM.from_pretrained(model_name)
|
7 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
8 |
tokenizer.pad_token = tokenizer.eos_token
|
|
|
40 |
additional_inputs=[
|
41 |
gr.Slider(minimum=50, maximum=150, value=100, step=1, label="Min length"),
|
42 |
gr.Slider(minimum=200, maximum=500, value=250, step=1, label="Max length"),
|
43 |
+
gr.Slider(minimum=1, maximum=1.9, value=1.2, step=0.1, label="Temperature"),
|
44 |
gr.Slider(minimum=1, maximum=100, value=50, step=1, label="Top-k"),
|
45 |
],
|
46 |
)
|