Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -10,10 +10,10 @@ def generate_text(prompt):
|
|
10 |
input_ids = tokenizer.encode(prompt, return_tensors="pt")
|
11 |
|
12 |
# Erstelle eine Attention-Mask, die überall '1' ist
|
13 |
-
attention_mask = torch.ones(input_ids.shape, dtype=torch.
|
14 |
|
15 |
# Bestimmung der maximalen Länge
|
16 |
-
max_length = model.config.n_positions if len(input_ids[0]) > model.config.n_positions else len(input_ids[0]) +
|
17 |
|
18 |
# Erzeugen von Text mit spezifischen Parametern
|
19 |
beam_output = model.generate(
|
|
|
10 |
input_ids = tokenizer.encode(prompt, return_tensors="pt")
|
11 |
|
12 |
# Erstelle eine Attention-Mask, die überall '1' ist
|
13 |
+
attention_mask = torch.ones(input_ids.shape, dtype=torch.long)
|
14 |
|
15 |
# Bestimmung der maximalen Länge
|
16 |
+
max_length = model.config.n_positions if len(input_ids[0]) > model.config.n_positions else len(input_ids[0]) + 100
|
17 |
|
18 |
# Erzeugen von Text mit spezifischen Parametern
|
19 |
beam_output = model.generate(
|