
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
Model: mruby/distilbert-base-uncased-finetuned-expertise-NER
Task: token-classification
If you're just getting started, we recommend that you try out the Bytez Model Playground directly or use one of our https://github.com/Bytez-com/docs/blob/main/README.md to access the Bytez Inference API.
You'll receive 100 free credits of inference each month!
https://github.com/Bytez-com/docs/blob/main/javascript/readme.md, https://github.com/Bytez-com/docs/blob/main/python/readme.md, and https://github.com/Bytez-com/docs/blob/main/julia/readme.md are currently supported.
You can play with models without having to write any code by visiting Bytez
<p>Models can also be explored:</p>
If that's not your cup of tea, keep reading!
Your API key will be front and center with a copy button, like you see in the image below:
bashdocker pull bytez/mruby_distilbert-base-uncased-finetuned-expertise-ner
bashdocker run -it \ -e KEY=YOUR_BYTEZ_API_KEY_HERE \ -e PORT=8000 \ -p 8000:8000 \ bytez/mruby_distilbert-base-uncased-finetuned-expertise-ner
NOTE you can adjust the port if needed by the -e PORT= environment variable and the -p option.
e.g. if you want to start the container on port 80, you'd do this instead:
bashdocker run -it \ -e KEY=YOUR_BYTEZ_API_KEY_HERE \ -e PORT=80 \ -p 80:80 \ bytez/mruby_distilbert-base-uncased-finetuned-expertise-ner
Send POST requests to the container and the model will reply.
bashcurl --location 'http://0.0.0.0:8000/run' \ --header 'Content-Type: application/json' \ --data-raw '{ "text": "Patient Information: Name: John Doe; Age: 45; Gender: Male; Date of Birth: March 15, 1979; Medical Record Number: 123456789; Date of Diagnosis: July 9, 2024; Chief Complaint: The patient presented with persistent abdominal pain, unexplained weight loss, and jaundice over the past two months; History of Present Illness: John Doe, a 45-year-old male, initially visited the clinic two months ago with complaints of dull, persistent abdominal pain, which has progressively worsened.", "params": {} }'
To ensure that weights are saved locally between runs, you can specify a directory for where you want weights to be stored.
For large models, this is highly recommeded, as download times can be hours for larger models.
This can be specified via the -v option
To do this, run the following command:
bashdocker run -it \ -v /PATH/TO/YOUR/CACHING/DIRECTORY/HERE:/server/model \ -e HF_HOME=/server/model \ -e KEY=YOUR_BYTEZ_API_KEY_HERE \ -p 8000:8000 \ -e PORT=8000 \ bytez/mruby_distilbert-base-uncased-finetuned-expertise-ner
Notice how in the command above we have -v /PATH/TO/YOUR/CACHING/DIRECTORY/HERE:/server/model and -e HF_HOME=/server/model
The -v /PATH/TO/YOUR/CACHING/DIRECTORY/HERE:/server/model says, mount the directory -v /PATH/TO/YOUR/CACHING/DIRECTORY/HERE to the docker container's filesystem at the directory /server/model
-e HF_HOME=/server/model allows the code to load the model from the directory in the docker container, i.e. from the /server/model directory.
On my machine, the command looks like this:
bashdocker run -it \ -v /home/inf3rnus/models:/server/model \ -e HF_HOME=/server/model \ -e KEY=YOUR_BYTEZ_API_KEY_HERE \ -p 8000:8000 \ -e PORT=8000 \ bytez/mruby_distilbert-base-uncased-finetuned-expertise-ner
To run on GPU(s), make sure you have the latest drivers from Nvidia and CUDA installed.
Then, simply run the command from above, but with --gpus all added to the list of docker options.
bashdocker run -it \ --gpus all \ -e KEY=YOUR_BYTEZ_API_KEY_HERE \ -p 8000:8000 \ -e PORT=8000 \ bytez/mruby_distilbert-base-uncased-finetuned-expertise-ner
The two commands from above com***ed into one:
bashdocker run -it \ --gpus all \ -v /PATH/TO/YOUR/CACHING/DIRECTORY/HERE:/server/model \ -e HF_HOME=/server/model \ -e KEY=YOUR_BYTEZ_API_KEY_HERE \ -p 8000:8000 \ -e PORT=8000 \ bytez/mruby_distilbert-base-uncased-finetuned-expertise-ner
-e DEVICE="SOME_VALUE_HERE"
Defaults to auto
Can be:
-e DEVICE="cuda"
or
-e DEVICE="auto"
or
-e DEVICE="cpu"
auto will atte*** to place the weights on the GPU if available, and then place them onto system RAM if there is not enough memory.
cuda will atte*** to place the weights on the GPU
cpu will atte*** to place the weights on the CPU
Allows you to specify with greater control which device you want to run the model on. Auto may split the model across system RAM and VRAM. You will often use this to atte*** forcing the model to be loaded onto the GPU.
NOTE: Some models only exclusively work with auto, cuda, or cpu
Hop into the Bytez *** for live support: the community is happy to help. If you don't have ***, email us.
top_p or higher are kept for generation. Default: 1.typical_p or higher are kept for generation. See https://arxiv.org/pdf/2202.00666.pdf for more details. Default: 1.epsilon_cutoff will be sampled. In the paper, suggested values range from 3e-4 to 9e-4, depending on the size of the model. See https://arxiv.org/abs/2210.*** for more details. Default: 0.eta_cutoff or sqrt(eta_cutoff) * exp(-entropy(softmax(next_token_logits))). The latter term is intuitively the expected next token probability, scaled by sqrt(eta_cutoff). In the paper, suggested values range from 3e-4 to 2e-3, depending on the size of the model. See https://arxiv.org/abs/2210. for more details. Default: 0.diversity_penalty is only effective if group beam search is enabled. Default: 0.length_penalty > 0.0 promotes longer sequences, while length_penalty < 0.0 encourages shorter sequences. Default: 1.~generation.NoBadWordsLogitsProcessor] for further documentation and examples.List[List[int]], this is treated as a simple list of words that must be included, the opposite to bad_words_ids. If given List[List[List[int]]], this triggers a https://github.com/huggingface/transformers/issues/***, where one can allow different forms of each word.True as the search algorithms suppose the score logits are normalized but some logit processors or warpers break the normalization. Default: false.Constraint objects, in the most sensible way possible.decoder_start_token_id. Useful for multilingual models like mBART where the first generated token needs to be the target language token. Default: model.config.forced_bos_token_id.max_length is reached. Optionally, use a list to set multiple end-of-sequence tokens. Default: model.config.forced_eos_token_id.remove_invalid_values can slow down generation. Default: model.config.remove_invalid_values.(start_index, decay_factor) where start_index indicates where penalty starts and decay_factor represents the factor of exponential decaySupressTokens logit processor will set their log probs to -inf so that they are not sampled.SupressBeginTokens logit processor will set their log probs to -inf so that they are not sampled.[[1, 123]] means the second generated token will always be a token of index 123.guidance_scale > 1. Higher guidance scale encourages the model to generate samples that are more closely linked to the input pro***, usually at the expense of poorer quality.attentions under returned tensors for more details. Default: false.hidden_states under returned tensors for more details. Default: false.scores under returned tensors for more details. Default: false.logits under returned tensors for more details.~utils.ModelOutput] instead of a plain tuple. Default: false.encoder_input_ids cannot occur in the decoder_input_ids. Default: 0.batch_size. Indicating a list enables different start ids for each element in the batch (e.g. multilingual models with different target languages in one batch)num_assistant_tokens make the generation more speculative: If the assistant model is performant larger speed-ups can be reached, if the assistant model requires lots of corrections, lower speed-ups are reached. Default: 5.heuristic: When all speculative tokens are correct, increase num_assistant_tokens by 2 else reduce by 1. num_assistant_tokens value is persistent over multiple generation calls with the same assistant model. - heuristic_transient: Same as heuristic but num_assistant_tokens is reset to its initial value after each generation call. - constant: num_assistant_tokens stays unchanged during generation Default: heuristic.generate function of the model. Kwargs that are not present in generate's signature will be used in the model forward pass.Full parameter list available https://github.com/huggingface/transformers/blob/v4.38.2/src/transformers/generation/configuration_utils.py, courtesy of Hugging Face.
Using models locally offers enhanced privacy, control, and customization for your projects. Happy building!
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务