|
<!DOCTYPE html> |
|
<html> |
|
<head> |
|
<title>Goals of the World Health Organization</title> |
|
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]/dist/tf.min.js"></script> |
|
<script src="https://cdn.jsdelivr.net/npm/@huggingface/[email protected]/dist/transformers.min.js"></script> |
|
<link rel="stylesheet" type="text/css" href="style.css"> |
|
<script> |
|
async function generateGoals() { |
|
|
|
const model = await transformers.gpt2.GPT2Model.fromPretrained("gpt2"); |
|
|
|
|
|
const tokenizer = await transformers.gpt2.GPT2Tokenizer.fromPretrained("gpt2"); |
|
|
|
|
|
const input = "The goals of the World Health Organization are"; |
|
|
|
|
|
const encodedInput = tokenizer.encode(input); |
|
|
|
|
|
const output = await model.generate(tf.tensor2d(encodedInput, [1, encodedInput.length]), { maxOutputLength: 200 }); |
|
|
|
|
|
const decodedOutput = tokenizer.decode(output.arraySync()[0], { skipSpecialTokens: true }); |
|
|
|
|
|
document.getElementById("goals").innerHTML = decodedOutput; |
|
document.getElementById("wholink").href = "https://www.who.int/about/mission/en/"; |
|
} |
|
</script> |
|
</head> |
|
<body onload="generateGoals()"> |
|
<div id="content"> |
|
<h1>Goals of the World Health Organization</h1> |
|
<p id="goals">Loading...</p> |
|
<img id="gif" src="https://media.giphy.com/media/l0MYt5jPR6QX5pnqM/giphy.gif" alt="GIF design"> |
|
<br> |
|
<a id="wholink" href="#">Learn more about the WHO</a> |
|
</div> |
|
</body> |
|
</html> |
|
|