Basic usage
Basic usage
Generate a summary
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('ainize/bart-base-cnn');
// provide the model with input
const input = "The tower is 324 metres (1,063 ft) tall, about the same height as an 81-storey building, and the tallest structure in Paris. Its base is square, measuring 125 metres (410 ft) on each side. It was the first structure to reach a height of 300 metres. Excluding transmitters, the Eiffel Tower is the second tallest free-standing structure in France after the Millau Viaduct.";
// provide the model with params
const params = {
"max_length": 40
};
// send to the model
const { error, output } = await model.run(input, params);
// observe the output
console.log({ error, output });
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("ainize/bart-base-cnn")
# provide the model with input
input = "The tower is 324 metres (1,063 ft) tall, about the same height as an 81-storey building, and the tallest structure in Paris. Its base is square, measuring 125 metres (410 ft) on each side. It was the first structure to reach a height of 300 metres. Excluding transmitters, the Eiffel Tower is the second tallest free-standing structure in France after the Millau Viaduct."
# provide the model with params
params = {
"max_length": 40
}
# send to the model
result = model.run(input, params)
# observe the output
print({"error": result.error, "output": result.output})
curl -X POST 'https://api.bytez.com/models/v2/ainize/bart-base-cnn' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"text": "The tower is 324 metres (1,063 ft) tall, about the same height as an 81-storey building, and the tallest structure in Paris. Its base is square, measuring 125 metres (410 ft) on each side. It was the first structure to reach a height of 300 metres. Excluding transmitters, the Eiffel Tower is the second tallest free-standing structure in France after the Millau Viaduct.",
"params": {
"max_length": 40
}
}'