Phi Model on Azure is Generating Random Results using the gen Grammar Function #1059
Replies: 1 comment 1 reply
-
I don't have an Azure endpoint to test this with, but have you tried including I would have expected it to still be working though, so maybe there's something in the |
Beta Was this translation helpful? Give feedback.
-
Hi!
I was trying to set up and get working with Phi on Azure. After spending a couple of hours trying to get normal (expected) responses, I decided to come here and ask for guidance in terms of what was going wrong.
Issue: The Azure Guidance object, which was instantiated using a Phi model hosted on Azure, is generating randomly off-topic responses.
Environment: Windows 10, Python Virtual Environment, VS Code. The Phi 3.5 model is hosted on Azure as a serverless API.
Code:
The Line Causing Issues:
Console Output:
(To clarify, my code was exactly how it was noted. I had not included anything about short stories, a hidden treasure or a backyard).
More Examples:
Example 1:
We will substitute our
user()
andassistant()
prompts with:Here is the console output:
The response is somewhat related this time, but it's still somewhat random.
Example 2:
Here's another example that was heavily inspired from the Phi-3CookBook. We will change our prompts to be:
Here's the console output:
The funny thing with this example is that if you change the regex from
r"\w+"
tor"[A-Za-z]+"
, you get the following console output:But if you change the regex to the exact one mentioned in the cookbook, which was
r"[A-Z][a-z]+"
, you get the perfect console output of:I can provide more examples, especially when the
gen()
function isn't inside anassistant()
tag, and the output will be a lot weirder,POST-MORTEM:
Guidance seemed like a really amazing tool, and I want to get to using it! But the seemingly outdated documentation, along with the random results you've seen above make it difficult to do so.
Really appreciate your help!
Beta Was this translation helpful? Give feedback.
All reactions