Skip to content

Commit

Permalink
Get the Mistral test working
Browse files Browse the repository at this point in the history
  • Loading branch information
riedgar-ms committed Apr 29, 2024
1 parent f348880 commit 0fc4727
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion guidance/models/_azureai_studio.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def _generator(self, prompt, temperature: float):
# and quite possibly belongs in a library function or superclass
# That said, I'm not _completely sure that there aren't subtle
# differences between the various versions

# find the role tags
pos = 0
role_end = b"<|im_end|>"
Expand Down
11 changes: 6 additions & 5 deletions tests/models/test_azureai_studio.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,16 @@ def test_azureai_mistral_chat_smoke(rate_limiter):
assert isinstance(lm, models.AzureAIStudioChat)
lm.engine.cache.clear()

with system():
lm += "You are a math wiz."
# No "system" role for Mistral?
# with system():
# lm += "You are a math wiz."

with user():
lm += "What is 1 + 1?"

with assistant():
lm += gen(max_tokens=10, name="text", temperature=0.5)
lm += "Pick a number: "
lm += gen(max_tokens=15, name="text", temperature=0.5)
lm += "\nPick a number: "

print(str(lm))
assert len(lm["text"]) < 0
assert len(lm["text"]) > 0

0 comments on commit 0fc4727

Please sign in to comment.