Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -60,9 +60,10 @@ def query(payload):
|
|
60 |
|
61 |
|
62 |
def inference(input_sentence, max_length, sample_or_greedy, raw_text=True):
|
|
|
63 |
payload = {
|
64 |
"inputs": input_sentence,
|
65 |
-
"do_sample":
|
66 |
# "max_new_tokens": max_length
|
67 |
}
|
68 |
|
@@ -113,7 +114,7 @@ gr.Interface(
|
|
113 |
[
|
114 |
gr.inputs.Textbox(label="Input"),
|
115 |
gr.inputs.Radio([64], default=64, label="Tokens to generate"),
|
116 |
-
gr.inputs.Radio(["sampling"], label="Sample or greedy", default="sampling"),
|
117 |
gr.Checkbox(label="Just output raw text", value=True),
|
118 |
],
|
119 |
["image", "text"],
|
|
|
60 |
|
61 |
|
62 |
def inference(input_sentence, max_length, sample_or_greedy, raw_text=True):
|
63 |
+
do_sample = sample_or_greedy == "sampling"
|
64 |
payload = {
|
65 |
"inputs": input_sentence,
|
66 |
+
"do_sample": do_sample,
|
67 |
# "max_new_tokens": max_length
|
68 |
}
|
69 |
|
|
|
114 |
[
|
115 |
gr.inputs.Textbox(label="Input"),
|
116 |
gr.inputs.Radio([64], default=64, label="Tokens to generate"),
|
117 |
+
gr.inputs.Radio(["sampling", "greedy"], label="Sample or greedy", default="sampling"),
|
118 |
gr.Checkbox(label="Just output raw text", value=True),
|
119 |
],
|
120 |
["image", "text"],
|