I keep getting <|eot_id|>
or </s>
in my outputs when using chat mode for llama-3-8b-instruct and mistral-7b-instruct.
#786
Replies: 3 comments
-
If I change the |
Beta Was this translation helpful? Give feedback.
-
I think this may have to do with incorrectly set |
Beta Was this translation helpful? Give feedback.
-
Part of my original problem appears to be related to putting the various chat roles inside of I finally got what I think is a working LLama3Chat class as follows: class Llama3Chat(LlamaCpp, Chat):
_begin_of_text: bool = False
def get_role_start(self, role_name, **kwargs):
_ = "" if self._begin_of_text else "<|begin_of_text|>"
self._begin_of_text = True
if role_name == "user":
return _ + "<|start_header_id|>user<|end_header_id|>\n\n"
elif role_name == "assistant":
return _ + "<|start_header_id|>assistant<|end_header_id|>\n\n"
elif role_name == "system":
return _ + "<|start_header_id|>system<|end_header_id|>\n\n"
def get_role_end(self, role_name=None):
return "<|eot_id|>" However, I still have issues with Is there an additional step I need to add to the Llama3Chat class or otherwise need to poke or prod to ensure the guidance library detects Response fragment:
Regex which causes the "social media tags" field to end up with def hashtags(lm: Model, temperature: float = 0.0, extra_instruct: str = "") -> Model:
options = {"wrap": 9999, "number": True}
with user():
prompt = mdformat.text(dedent(f"""
Write a single-line social media hashtags paragraph suitable for improved SEO ranking.
Provide exactly 3 hashtags.
Separate each hashtag with a space.
Start each hashtag with a #.
Always add a blank line after the hashtags.
"""), options=options)
if extra_instruct.strip():
prompt += "\n\n" + mdformat.text(extra_instruct.strip(), options=options)
lm += mdformat.text(prompt, options=options)
with assistant():
lm += "Social Media Hashtags: "
hash_regex_a = "#[^#, ]+ #[^#, ]+ #[^#, ]+\n"
lm += gen(regex=hash_regex_a, temperature=temperature, name="hashtags")
return lm |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using system(), user(), and assistant() but I keep getting either
</s>
(for Mistral) or<|eot_id|><|start_header_id|>assistant
for llama-3-8b-instruct in my outputs.What am I doing wrong?
I'm using the following to load the models:
and I'm using the following for my tests:
Beta Was this translation helpful? Give feedback.
All reactions