arieridwans commited on
Commit
2195eff
1 Parent(s): 07aebcc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -24,12 +24,12 @@ user_prompt = st.text_area("Enter your prompt that can be song lyrics:", """Yest
24
  if st.button("Generate Output"):
25
  instruct_prompt = "Instruct:You are a song writer and your main reference is The Beatles. Write a song lyrics by completing these words:"
26
  output_prompt = "Output:"
27
- input = inference_tokenizer(""" {0}{1}\n{2} """.format(instruct_prompt, user_prompt, output_prompt),
28
  return_tensors="pt",
29
  return_attention_mask=False,
30
  padding=True,
31
  truncation=True)
32
  result = inference_model.generate(**input, repetition_penalty=1.2, max_length=1024)
33
- output = inference_tokenizer.batch_decode(result, skip_special_tokens=True)[0]
34
  st.text("Generated Result:")
35
  st.write(output)
 
24
  if st.button("Generate Output"):
25
  instruct_prompt = "Instruct:You are a song writer and your main reference is The Beatles. Write a song lyrics by completing these words:"
26
  output_prompt = "Output:"
27
+ input = tokenizer(""" {0}{1}\n{2} """.format(instruct_prompt, user_prompt, output_prompt),
28
  return_tensors="pt",
29
  return_attention_mask=False,
30
  padding=True,
31
  truncation=True)
32
  result = inference_model.generate(**input, repetition_penalty=1.2, max_length=1024)
33
+ output = tokenizer.batch_decode(result, skip_special_tokens=True)[0]
34
  st.text("Generated Result:")
35
  st.write(output)