Samuel L Meyers commited on
Commit
320c4ed
1 Parent(s): ebdfe5b

Hello, future.

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -35,9 +35,12 @@ lcpp_model = Llama(model_path=mdlpath)
35
 
36
  def m3b_talk(text):
37
  resp = ""
38
- for token in lcpp_model("<s> [|User|]" + text + "</s> [|Assistant|]", stop=["[|User|]", "\n"], echo=True):
 
 
39
  resp += token
40
- return resp
 
41
 
42
  def main():
43
  logging.basicConfig(level=logging.INFO)
 
35
 
36
  def m3b_talk(text):
37
  resp = ""
38
+ formattedQuery = "<s> [|User|]" + text + "</s> [|Assistant|]"
39
+
40
+ for token in lcpp_model(formattedQuery, stop=["[|User|]", "\n"], echo=True):
41
  resp += token
42
+ answer = resp["choices"][0]["text"].replace(formattedQuery, "")
43
+ return answer
44
 
45
  def main():
46
  logging.basicConfig(level=logging.INFO)