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
LLM的url具体是什么呢,以Qwen为例可以举一个例子吗 #6
Comments
因为我们做大规模的测试,需要多个人同时访问大模型,所以就把模型部署到共有的服务器上,封装成API了,这样可以方便多个人使用,remote.py 里的模型都是这样。所以如果你要用Qwen的话,可能需要
如果不想使用上面的办法,也可以尝试:
|
大概两周左右,我们会再增加一个模块,支持从本地GPU自动部署和调起评估框架,感谢您的关注! In about two weeks, we will add another module that supports automatic deployment and invocation of the evaluation framework from a local GPU. Appreciate your interest! |
好的,非常感谢您的解答 |
feat: added TruthfulQA dataset and corresponding evaluator
请问目前这项工作的还在正常进行吗 |
是的还在正常进行的哈,目前主分支已经支持从本地加载大模型啦。参见uhgeval/llm/local.py文件 |
这里再正式回复下,大模型里的 url 可以通过使用 vLLM 的方式实现,具体步骤如下:
CUDA_VISIBLE_DEVICES=0,1,2,3 python -m vllm.entrypoints.api_server \
--model /this/is/an/example/path/to/Qwen/Qwen-7B-Chat \
--host 0.0.0.0 \
--port 8000 \
--tensor-parallel-size 4
curl http://localhost:8000/generate \
-d '{
"prompt": "San Francisco is a",
"use_beam_search": true,
"n": 4,
"temperature": 0
}' url = http://localhost:8000/generate
payload = json.dumps({
"prompt": 'hello world',
"temperature": 0.1,
"max_tokens": 16,
"n": 1
})
headers = {
'Content-Type': 'application/json'
}
res = requests.request("POST", url, headers=headers, data=payload)
res = res.json()['text'][0].replace(query, '') # VLLM will automatically append the query to the response, so here we remove it.
return res 使用 vLLM 的好处是可以实现请求的批处理,评测速度快。当然目前 uhgeval/llm/local.py 也实现了从 HuggingFace 的 transformer 库直接加载模型的方法,以供参考。 |
请问可以直接下载大模型到本地,添加本地路径吗? |
可以的哈,目前已经支持通过huggingface的trasformers库加载大模型了,参考这个文件:./uhgeval/llm/local.py |
好的,谢谢您!我可以只添加我的本地模型,不改变其他的,就把路径改成我本地模型路径就可以了,是吧?
…------------------ 原始邮件 ------------------
发件人: "Shichao ***@***.***>;
发送时间: 2024年1月26日(星期五) 下午5:47
收件人: ***@***.***>;
抄送: ***@***.***>; ***@***.***>;
主题: Re: [IAAR-Shanghai/UHGEval] LLM的url具体是什么呢,以Qwen为例可以举一个例子吗 (Issue #6)
请问可以直接下载大模型到本地,添加本地路径吗?
可以的哈,目前已经支持通过huggingface的trasformers库加载大模型了,参考这个文件:./uhgeval/llm/local.py
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
请问metric可以从huggingface下载到本地吗?我没代理,不能访问huggingface |
对,是的 |
对的,你可以参考下这里的处理办法 https://github.com/IAAR-Shanghai/UHGEval/tree/main/uhgeval/.cache/huggingface。这里实现的rouge和bleu就是下载到本地的方法。 |
建议大家不要在这个 issue 下提问题啦。如果有新的问题建议新开一个 issue 哈。这样我们可以保证单个 issue 的独立性。 |
No description provided.
The text was updated successfully, but these errors were encountered: