Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -111,7 +111,7 @@ def engine(input_embeds):
|
|
111 |
batch_input_embeds = input_embeds[start:start+batch_size]
|
112 |
outputs = m.generate(
|
113 |
inputs_embeds = batch_input_embeds.to("cuda"),
|
114 |
-
max_new_tokens =
|
115 |
do_sample = True,
|
116 |
temperature = 0.6,
|
117 |
top_p = 0.9,
|
@@ -209,8 +209,8 @@ def chat(message, history, with_defense,threshold):
|
|
209 |
messages = tok.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)
|
210 |
# Tokenize the messages string
|
211 |
input_ids = tok([messages], return_tensors="pt")["input_ids"]
|
212 |
-
response= "[Gradient Cuff Checking: "+reject_information + "]\n"+ chat_engine(input_ids)
|
213 |
-
|
214 |
response=response.split(" ")
|
215 |
|
216 |
# Initialize an empty string to store the generated text
|
|
|
111 |
batch_input_embeds = input_embeds[start:start+batch_size]
|
112 |
outputs = m.generate(
|
113 |
inputs_embeds = batch_input_embeds.to("cuda"),
|
114 |
+
max_new_tokens = 16,
|
115 |
do_sample = True,
|
116 |
temperature = 0.6,
|
117 |
top_p = 0.9,
|
|
|
209 |
messages = tok.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)
|
210 |
# Tokenize the messages string
|
211 |
input_ids = tok([messages], return_tensors="pt")["input_ids"]
|
212 |
+
#response= "[Gradient Cuff Checking: "+reject_information + "]\n"+ chat_engine(input_ids)
|
213 |
+
response=chat_engine(input_ids)
|
214 |
response=response.split(" ")
|
215 |
|
216 |
# Initialize an empty string to store the generated text
|