Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Usage]: how do I pass in the JSON content-type for Mistral 7B using offline inference? #7030

Closed
RoopeHakulinen opened this issue Aug 1, 2024 · 1 comment · Fixed by #6878
Labels
usage How to use vllm

Comments

@RoopeHakulinen
Copy link

Your current environment

The output of `python collect_env.py`

How would you like to use vllm

I would like to use the JSON mode for Mistral 7B while doing offline inference using the generate method as below. Is that possible somehow? Just using the prompt doesn't seem to produce JSON output as requested. If this is not possible, is the only solution to use something like Outlines? Would love some details on that, if so.

llm = LLM(model="mistralai/Mistral-7B-v0.3")
prompt = "Please name the biggest and smallest continent in JSON using the following schema: {biggest: <the biggest continent's name>, smallest: <the smallest continent>}"
sampling_params = SamplingParams(temperature=temperature, top_p=1.0)
response = self.llm.generate(prompt, sampling_params)
@DarkLight1337
Copy link
Member

DarkLight1337 commented Aug 1, 2024

This will become available to offline LLM by #6878.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
usage How to use vllm
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants