KhantKyaw commited on
Commit
bace4b7
·
verified ·
1 Parent(s): 6fd5a3c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -24,14 +24,14 @@ def generate_response(input_text):
24
 
25
  response_with_prefix = tokenizer.decode(output_sequences[:, input_ids.shape[-1]:][0], skip_special_tokens=True)
26
  response_start_idx = response_with_prefix.find("answer: ")
27
- if response_start_idx != -1:
28
 
29
- response = response_with_prefix[response_start_idx + len("answer: "):]
30
- else:
31
 
32
- response = response_with_prefix
33
 
34
- return response
35
 
36
  prompt = st.chat_input(placeholder="Say Something!",key=None, max_chars=None, disabled=False, on_submit=None, args=None, kwargs=None)
37
  if prompt:
 
24
 
25
  response_with_prefix = tokenizer.decode(output_sequences[:, input_ids.shape[-1]:][0], skip_special_tokens=True)
26
  response_start_idx = response_with_prefix.find("answer: ")
27
+ if response_start_idx != -1:
28
 
29
+ response = response_with_prefix[response_start_idx + len("answer: "):]
30
+ else:
31
 
32
+ response = response_with_prefix
33
 
34
+ return response
35
 
36
  prompt = st.chat_input(placeholder="Say Something!",key=None, max_chars=None, disabled=False, on_submit=None, args=None, kwargs=None)
37
  if prompt: