Spaces:
Build error
Build error
few more fixed for chatbot
Browse files
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:
|
145 |
-
FRITZ:
|
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 |
-
|
|
|
162 |
print(f"OUTPUT ({datetime.now()}):\n-------\n")
|
163 |
# Load prompt
|
164 |
-
|
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"]
|