TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Easily generate text and compute probabilities for any Hugging Face LLM

2 点作者 rck9 个月前
A python library and command line scripts to simplify working with language models.<p>In the course of studying EleutherAI&#x27;s Language Model Evaluation Harness, we found ourselves wanting to be able to use their clean LM interface for our own projects, particularly with models from the Hugging Face model hub. Starting from the lm-evaluation-harness code, we built a standalone HFLM class that you can easily import into your Python projects to quickly generate text and compute log probabilities of arbitrary strings.<p>We also wrote two scripts to let you play with LMs from the command line: lmprob takes a model and a string and returns the log probability of the string according to the model, and lmgen takes a model and a string and generates some completion text. If you&#x27;ve ever wanted to write shell scripts that make decisions and take actions using an LLM, these scripts will help you do that.

暂无评论

暂无评论