bankholdup commited on
Commit
eb38bb6
1 Parent(s): 931dc99

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -27,7 +27,6 @@ title.title("ruGPT3 Song Writer")
27
  context = st.text_input("Введите начало песни", "Как дела? Как дела? Это новый кадиллак")
28
 
29
  if st.button("Поехали", help="Может занять какое-то время"):
30
- st.title(f"{context}")
31
  prefix_text = f"{context}"
32
  encoded_prompt = tokenizer.encode(prefix_text, add_special_tokens=False, return_tensors="pt")
33
  output_sequences = model.generate(
@@ -53,7 +52,7 @@ if st.button("Поехали", help="Может занять какое-то в
53
  text = tokenizer.decode(generated_sequence, clean_up_tokenization_spaces=True)
54
 
55
  # Remove all text after the stop token
56
- text = text[: text.find(args.stop_token) if args.stop_token else None]
57
 
58
  # Add the prompt at the beginning of the sequence. Remove the excess text that was used for pre-processing
59
  total_sequence = (
 
27
  context = st.text_input("Введите начало песни", "Как дела? Как дела? Это новый кадиллак")
28
 
29
  if st.button("Поехали", help="Может занять какое-то время"):
 
30
  prefix_text = f"{context}"
31
  encoded_prompt = tokenizer.encode(prefix_text, add_special_tokens=False, return_tensors="pt")
32
  output_sequences = model.generate(
 
52
  text = tokenizer.decode(generated_sequence, clean_up_tokenization_spaces=True)
53
 
54
  # Remove all text after the stop token
55
+ text = text[: text.find("</s>") if "</s>" else None]
56
 
57
  # Add the prompt at the beginning of the sequence. Remove the excess text that was used for pre-processing
58
  total_sequence = (