Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -35,7 +35,7 @@ class TuluChatBot:
|
|
35 |
self.system_message = new_system_message
|
36 |
|
37 |
def format_prompt(self, user_message):
|
38 |
-
prompt = f"<|assistant|>\n
|
39 |
return prompt
|
40 |
|
41 |
def Tulu(self, user_message, temperature, max_new_tokens, top_p, repetition_penalty, do_sample):
|
@@ -57,6 +57,7 @@ class TuluChatBot:
|
|
57 |
|
58 |
response = self.tokenizer.decode(output_ids[0], skip_special_tokens=True)
|
59 |
response = response.strip()
|
|
|
60 |
return response
|
61 |
|
62 |
def gradio_Tulu(user_message, system_message, max_new_tokens, temperature, top_p, repetition_penalty, do_sample):
|
|
|
35 |
self.system_message = new_system_message
|
36 |
|
37 |
def format_prompt(self, user_message):
|
38 |
+
prompt = f"<|assistant|>\n{self.system_message}\n<|user|>{user_message}\n<|assistant|>\n"
|
39 |
return prompt
|
40 |
|
41 |
def Tulu(self, user_message, temperature, max_new_tokens, top_p, repetition_penalty, do_sample):
|
|
|
57 |
|
58 |
response = self.tokenizer.decode(output_ids[0], skip_special_tokens=True)
|
59 |
response = response.strip()
|
60 |
+
response = response.split("<|assistant|>\n")[-1]
|
61 |
return response
|
62 |
|
63 |
def gradio_Tulu(user_message, system_message, max_new_tokens, temperature, top_p, repetition_penalty, do_sample):
|