Model: microsoft/ssr-base
Task: summarization
If you're just getting started, we recommend that you try out the Bytez Model Playground directly or use one of our Client Libraries to access the Bytez Inference API.
You'll receive 100 free credits of inference each month!
Javascript, Python, and Julia are currently supported.
You can play with models without having to write any code by visiting Bytez
Models can also be explored:
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:
docker pull bytez/microsoft_ssr-base
docker run -it \
-e KEY=YOUR_BYTEZ_API_KEY_HERE \
-e PORT=8000 \
-p 8000:8000 \
bytez/microsoft_ssr-base
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:
docker run -it \
-e KEY=YOUR_BYTEZ_API_KEY_HERE \
-e PORT=80 \
-p 80:80 \
bytez/microsoft_ssr-base
Send POST requests to the container and the model will reply.
curl --location 'http://0.0.0.0:8000/run' \
--header 'Content-Type: application/json' \
--data-raw '{
"text": "New York (CNN) When Liana Barrientos was 23 years old, she got married in Westchester County, New York. A year later, she got married again in Westchester County, but to a different man and without divorcing her first husband. Only 18 days after that marriage, she got hitched yet again. Then, Barrientos declared \"I do\" five more times, sometimes only within two weeks of each other. In 2010, she married once more, this time in the Bronx. In an application for a marriage license, she stated it was her \"first and only\" marriage. Barrientos, now 39, is facing two criminal counts of \"offering a false instrument for filing in the first degree,\" referring to her false statements on the 2010 marriage license application, according to court documents. Prosecutors said the marriages were part of an immigration scam. On Friday, she pleaded not guilty at State Supreme Court in the Bronx, according to her attorney, Christopher Wright, who declined to comment further. After leaving court, Barrientos was arrested and charged with theft of service and criminal trespass for allegedly sneaking into the New York subway through an emergency exit, said Detective Annette Markowski, a police spokeswoman. In total, Barrientos has been married 10 times, with nine of her marriages occurring between 1999 and 2002. All occurred either in Westchester County, Long Island, New Jersey or the Bronx. She is believed to still be married to four men, and at one time, she was married to eight men at once, prosecutors say. Prosecutors said the immigration scam involved some of her husbands, who filed for permanent residence status shortly after the marriages. Any divorces happened only after such filings were approved. It was unclear whether any of the men will be prosecuted. The case was referred to the Bronx District Attorney's Office by Immigration and Customs Enforcement and the Department of Homeland Security's Investigation Division. Seven of the men are from so-called \"red-flagged\" countries, including Egypt, Turkey, Georgia, Pakistan and Mali. Her eighth husband, Rashid Rajput, was deported in 2006 to his native Pakistan after an investigation by the Joint Terrorism Task Force. If convicted, Barrientos faces up to four years in prison. Her next court appearance is scheduled for May 18.",
"params": {
"truncation": true,
"min_length": 30,
"max_length": 130
}
}'
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:
docker 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/microsoft_ssr-base
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:
docker 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/microsoft_ssr-base
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.
docker run -it \
--gpus all \
-e KEY=YOUR_BYTEZ_API_KEY_HERE \
-p 8000:8000 \
-e PORT=8000 \
bytez/microsoft_ssr-base
The two commands from above combined into one:
docker 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/microsoft_ssr-base
-e DEVICE="SOME_VALUE_HERE"
Defaults to auto
Can be:
-e DEVICE="cuda"
or
-e DEVICE="auto"
or
-e DEVICE="cpu"
auto will attempt to place the weights on the GPU if available, and then place them onto system RAM if there is not enough memory.
cuda will attempt to place the weights on the GPU
cpu will attempt 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 attempt forcing the model to be loaded onto the GPU.
NOTE: Some models only exclusively work with auto, cuda, or cpu
Hop into the Bytez discord for live support: the community is happy to help. If you don't have discord, email us.
top_p or higher are kept for generation. Default: 1.typical_p or higher are kept for generation. See this paper 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 Truncation Sampling as Language Model Desmoothing 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 Truncation Sampling as Language Model Desmoothing 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 disjunctive constraint, 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 prompt, 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 here, courtesy of Hugging Face.
Using models locally offers enhanced privacy, control, and customization for your projects. Happy building!
Content type
Image
Digest
sha256:bef0135e2…
Size
3.2 GB
Last updated
about 2 years ago
docker pull bytez/microsoft_ssr-base