gururise commited on
Commit
77b370c
·
1 Parent(s): 47dc020

few more fixed for chatbot

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -141,8 +141,8 @@ USER: solve for a: 9-a=2
141
  FRITZ: The answer is a=7, because 9-7 = 2.
142
  USER: wat is lhc
143
  FRITZ: The Large Hadron Collider (LHC) is a high-energy particle collider, built by CERN, and completed in 2008. It was used to confirm the existence of the Higgs boson in 2012.
144
- USER: Do you know who I am?
145
- FRITZ: Only if you tell me more about yourself.. what are your interests?
146
  '''
147
 
148
  max_new_tokens = int(max_new_tokens)
@@ -157,11 +157,12 @@ FRITZ: Only if you tell me more about yourself.. what are your interests?
157
 
158
  if temperature == 0.0:
159
  temperature = 0.01
160
-
161
- print(f"CHAT ({datetime.now()}):\n-------\n{prompt}")
 
162
  print(f"OUTPUT ({datetime.now()}):\n-------\n")
163
  # Load prompt
164
- prompt = "USER: " + prompt + "\n"
165
  model.loadContext(newctx=intro+prompt)
166
 
167
  generated_text = model.forward(number=max_new_tokens, stopStrings=stop,temp=temperature,top_p_usual=top_p)["output"]
 
141
  FRITZ: The answer is a=7, because 9-7 = 2.
142
  USER: wat is lhc
143
  FRITZ: The Large Hadron Collider (LHC) is a high-energy particle collider, built by CERN, and completed in 2008. It was used to confirm the existence of the Higgs boson in 2012.
144
+ USER: Tell me about yourself.
145
+ FRITZ: I am an RNN based Large Language Model (LLM) that use no attention layers unlike most other LLM's which are transformer based.
146
  '''
147
 
148
  max_new_tokens = int(max_new_tokens)
 
157
 
158
  if temperature == 0.0:
159
  temperature = 0.01
160
+
161
+ prompt = "USER: " + prompt + "\n"
162
+ print(f"CHAT ({datetime.now()}):\n-------\n{intro+prompt}")
163
  print(f"OUTPUT ({datetime.now()}):\n-------\n")
164
  # Load prompt
165
+
166
  model.loadContext(newctx=intro+prompt)
167
 
168
  generated_text = model.forward(number=max_new_tokens, stopStrings=stop,temp=temperature,top_p_usual=top_p)["output"]