ysharma HF staff commited on
Commit
536eb1b
1 Parent(s): a801021
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -60,6 +60,7 @@ def lang_model_response(prompt):
60
  p = """Reply to this text in one short sentence.
61
  text: """
62
  #prompt = p + prompt + "\n" #+ "Response: "
 
63
 
64
  if len(prompt) == 0:
65
  prompt = """Can you help me please?"""
@@ -83,12 +84,12 @@ def lang_model_response(prompt):
83
  print(f"output is : {output}")
84
  output_tmp = output[0]['generated_text']
85
  print(f"output_tmp is: {output_tmp}")
86
- if '?' in prompt:
87
- solution = output_tmp.split("?")[1]
88
- elif '.' in prompt:
89
- solution = output_tmp.split(".")[1]
90
- else:
91
- solution = output_tmp.split("\n")[1]
92
 
93
  print(f"Final response after splits is: {solution}")
94
  return solution
 
60
  p = """Reply to this text in one short sentence.
61
  text: """
62
  #prompt = p + prompt + "\n" #+ "Response: "
63
+ prompt = prompt + "\n"
64
 
65
  if len(prompt) == 0:
66
  prompt = """Can you help me please?"""
 
84
  print(f"output is : {output}")
85
  output_tmp = output[0]['generated_text']
86
  print(f"output_tmp is: {output_tmp}")
87
+ #if '?' in prompt:
88
+ # solution = output_tmp.split("?")[1]
89
+ #elif '.' in prompt:
90
+ # solution = output_tmp.split(".")[1]
91
+ #else:
92
+ solution = output_tmp.split("\n")[1]
93
 
94
  print(f"Final response after splits is: {solution}")
95
  return solution