Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -18,11 +18,12 @@ st.title("Stupid jokes with transformers")
|
|
18 |
st.write("Write question you want to see a funny answer for.")
|
19 |
sent = st.text_area("Text", height = 100)
|
20 |
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
|
|
|
18 |
st.write("Write question you want to see a funny answer for.")
|
19 |
sent = st.text_area("Text", height = 100)
|
20 |
|
21 |
+
if sent:
|
22 |
+
max_source_length = 64
|
23 |
+
max_target_length = 32
|
24 |
+
prefix = "Answer the following question in a funny way: "
|
25 |
+
|
26 |
+
input_ids = tokenizer(prefix + sent, max_length=max_source_length, truncation=True, return_tensors="pt").input_ids
|
27 |
+
generated_sequence = infer(input_ids)
|
28 |
+
|
29 |
+
st.write(generated_sequence)
|