Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ def generate_text(prompt):
|
|
10 |
input_ids = tokenizer.encode(prompt, return_tensors="pt")
|
11 |
attention_mask = torch.ones(input_ids.shape, dtype=torch.bool)
|
12 |
|
13 |
-
max_length = model.config.n_positions if len(input_ids[0]) > model.config.n_positions else len(input_ids[0]) +
|
14 |
beam_output = model.generate(
|
15 |
input_ids,
|
16 |
attention_mask=attention_mask,
|
@@ -50,7 +50,7 @@ css = """
|
|
50 |
# Update the Blocks structure to reflect the desired layout
|
51 |
with gr.Blocks(css=css) as demo:
|
52 |
gr.Markdown(DESCRIPTION)
|
53 |
-
|
54 |
gr.DuplicateButton(value="Duplicate Space for private use", elem_id="duplicate-button")
|
55 |
with gr.Row().style(equal_height=False):
|
56 |
output_box = gr.Textbox(interactive=False, lines=25, placeholder="Responses will appear here...", elem_id="output-box")
|
|
|
10 |
input_ids = tokenizer.encode(prompt, return_tensors="pt")
|
11 |
attention_mask = torch.ones(input_ids.shape, dtype=torch.bool)
|
12 |
|
13 |
+
max_length = model.config.n_positions if len(input_ids[0]) > model.config.n_positions else len(input_ids[0]) + 50
|
14 |
beam_output = model.generate(
|
15 |
input_ids,
|
16 |
attention_mask=attention_mask,
|
|
|
50 |
# Update the Blocks structure to reflect the desired layout
|
51 |
with gr.Blocks(css=css) as demo:
|
52 |
gr.Markdown(DESCRIPTION)
|
53 |
+
|
54 |
gr.DuplicateButton(value="Duplicate Space for private use", elem_id="duplicate-button")
|
55 |
with gr.Row().style(equal_height=False):
|
56 |
output_box = gr.Textbox(interactive=False, lines=25, placeholder="Responses will appear here...", elem_id="output-box")
|