Skip to content

Commit

Permalink
Starting to test mistral too.... not fully working yet
Browse files Browse the repository at this point in the history
  • Loading branch information
riedgar-ms committed Apr 29, 2024
1 parent 1265346 commit f348880
Showing 1 changed file with 32 additions and 5 deletions.
37 changes: 32 additions & 5 deletions tests/models/test_azureai_studio.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
pytestmark = pytest.mark.needs_credentials


def test_azureai_openai_chat_smoke(rate_limiter):
azureai_studio_endpoint = env_or_fail("AZURE_AI_STUDIO_ENDPOINT")
azureai_studio_deployment = env_or_fail("AZURE_AI_STUDIO_DEPLOYMENT")
azureai_studio_key = env_or_fail("AZURE_AI_STUDIO_KEY")
def test_azureai_phi3_chat_smoke(rate_limiter):
azureai_studio_endpoint = env_or_fail("AZURE_AI_STUDIO_PHI3_ENDPOINT")
azureai_studio_deployment = env_or_fail("AZURE_AI_STUDIO_PHI3_DEPLOYMENT")
azureai_studio_key = env_or_fail("AZURE_AI_STUDIO_PHI3_KEY")

lm = models.AzureAIStudioChat(
azureai_studio_endpoint=azureai_studio_endpoint,
Expand All @@ -30,8 +30,35 @@ def test_azureai_openai_chat_smoke(rate_limiter):
lm += "What is 1 + 1?"

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

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


def test_azureai_mistral_chat_smoke(rate_limiter):
azureai_studio_endpoint = env_or_fail("AZURE_AI_STUDIO_MISTRAL_CHAT_ENDPOINT")
azureai_studio_deployment = env_or_fail("AZURE_AI_STUDIO_MISTRAL_CHAT_DEPLOYMENT")
azureai_studio_key = env_or_fail("AZURE_AI_STUDIO_MISTRAL_CHAT_KEY")

lm = models.AzureAIStudioChat(
azureai_studio_endpoint=azureai_studio_endpoint,
azureai_studio_deployment=azureai_studio_deployment,
azureai_studio_key=azureai_studio_key,
)
assert isinstance(lm, models.AzureAIStudioChat)
lm.engine.cache.clear()

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: "

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

0 comments on commit f348880

Please sign in to comment.