dspy icon indicating copy to clipboard operation
dspy copied to clipboard

Working with HFModels locally

Open EngSalem opened this issue 1 year ago • 4 comments

I am trying to use the dspy.HFModel object to load models locally. I keep getting

ValueError: temperature has to be a strictly positive float, but is 0.0

I tried to set temperature while setting configuration as follows

dspy.settings.configure(lm=llama, temperture=0.7)

But without any success

EngSalem avatar Jan 29 '24 22:01 EngSalem

Thank you @EngSalem . Could you try TGI instead? HFClientTGI is the main way to use local models at the moment.

okhat avatar Jan 29 '24 22:01 okhat

Is there a way to instantiate TGI servers with a quantized version? The current llama-13b instance is throwing errors whenever I try to identify a new signature module

EngSalem avatar Jan 29 '24 22:01 EngSalem

Honestly I'd love to be able to support that. We also have VLLM support.

I don't know how to work with quantized models but if we figure it out, it would be great for us and everyone :D

okhat avatar Jan 29 '24 22:01 okhat

Thank you! I will try to see if I can do a workaround and if I can find anything I will update this thread.

EngSalem avatar Jan 29 '24 22:01 EngSalem

I am trying to use the dspy.HFModel object to load models locally. I keep getting

ValueError: temperature has to be a strictly positive float, but is 0.0

I tried to set temperature while setting configuration as follows

dspy.settings.configure(lm=llama, temperture=0.7)

But without any success

Hi i have same problem, do you solve this?

IcyFeather233 avatar Jun 17 '24 11:06 IcyFeather233

@IcyFeather233 It's fixed in the DSPy version that's in main, but there hasn't been a release yet. So you could clone and install from the repo. Maybe it's enough to disable sampling, this is that fix that has been merged for this:

        if 'temperature' in kwargs and kwargs['temperature'] == 0.0:
            kwargs['do_sample'] = False

tom-doerr avatar Jun 17 '24 12:06 tom-doerr

@IcyFeather233 It's fixed in the DSPy version that's in main, but there hasn't been a release yet. So you could clone and install from the repo. Maybe it's enough to disable sampling, this is that fix that has been merged for this:

        if 'temperature' in kwargs and kwargs['temperature'] == 0.0:
            kwargs['do_sample'] = False

Thanks! I use pip install -Ue . to install from repo and it's been solved!

IcyFeather233 avatar Jun 18 '24 02:06 IcyFeather233