Spaces:
Build error
Build error
bankholdup
commited on
Commit
•
5bfd425
1
Parent(s):
dc60d3c
Update app.py
Browse files
app.py
CHANGED
@@ -26,6 +26,7 @@ generated_sequences = []
|
|
26 |
|
27 |
if st.button("Поехали", help="Может занять какое-то время"):
|
28 |
set_seed()
|
|
|
29 |
prompt_text = f"{context}"
|
30 |
encoded_prompt = tokenizer.encode(prompt_text, add_special_tokens=False, return_tensors="pt")
|
31 |
output_sequences = model.generate(
|
@@ -46,13 +47,15 @@ if st.button("Поехали", help="Может занять какое-то в
|
|
46 |
generated_sequence = generated_sequence.tolist()
|
47 |
|
48 |
text = tokenizer.decode(generated_sequence, clean_up_tokenization_spaces=True)
|
|
|
49 |
|
50 |
-
|
51 |
|
52 |
-
total_sequence = (
|
53 |
-
|
54 |
-
)
|
55 |
|
56 |
# generated_sequences.append(total_sequence)
|
57 |
# os.system('clear')
|
58 |
-
st.
|
|
|
|
26 |
|
27 |
if st.button("Поехали", help="Может занять какое-то время"):
|
28 |
set_seed()
|
29 |
+
st.title("Генерируем")
|
30 |
prompt_text = f"{context}"
|
31 |
encoded_prompt = tokenizer.encode(prompt_text, add_special_tokens=False, return_tensors="pt")
|
32 |
output_sequences = model.generate(
|
|
|
47 |
generated_sequence = generated_sequence.tolist()
|
48 |
|
49 |
text = tokenizer.decode(generated_sequence, clean_up_tokenization_spaces=True)
|
50 |
+
st.write(text)
|
51 |
|
52 |
+
# text = text[: text.find("</s>") if "</s>" else None]
|
53 |
|
54 |
+
#total_sequence = (
|
55 |
+
# prompt_text + text[len(tokenizer.decode(encoded_prompt[0], clean_up_tokenization_spaces=True)) :]
|
56 |
+
#)
|
57 |
|
58 |
# generated_sequences.append(total_sequence)
|
59 |
# os.system('clear')
|
60 |
+
st.title("")
|
61 |
+
#st.write(total_sequence)
|