svjack / comet-atomic-en

huggingface.co
Total runs: 41
24-hour runs: -1
7-day runs: -9
30-day runs: -83
Model's Last Updated: February 22 2023
text-generation

Introduction of comet-atomic-en

Model Details of comet-atomic-en

from transformers import T5ForConditionalGeneration
from transformers import T5TokenizerFast as T5Tokenizer
import pandas as pd
model = "svjack/comet-atomic-en"
device = "cpu"
#device = "cuda:0"
tokenizer = T5Tokenizer.from_pretrained(model)
model = T5ForConditionalGeneration.from_pretrained(model).to(device).eval()

NEED_PREFIX = 'What are the necessary preconditions for the next event?'
EFFECT_PREFIX = 'What could happen after the next event?'
INTENT_PREFIX = 'What is the motivation for the next event?'
REACT_PREFIX = 'What are your feelings after the following event?'


event = "X had a big meal."
for prefix in [NEED_PREFIX, EFFECT_PREFIX, INTENT_PREFIX, REACT_PREFIX]:
    prompt = "{}{}".format(prefix, event)
    encode = tokenizer(prompt, return_tensors='pt').to(device)
    answer = model.generate(encode.input_ids,
                           max_length = 128,
        num_beams=2,
        top_p = 0.95,
        top_k = 50,
        repetition_penalty = 2.5,
        length_penalty=1.0,
        early_stopping=True,
                           )[0]
    decoded = tokenizer.decode(answer, skip_special_tokens=True)
    print(prompt, "\n---Answer:", decoded, "----\n")

What are the necessary preconditions for the next event?X had a big meal. 
---Answer: X goes shopping at the supermarket ----

What could happen after the next event?X had a big meal. 
---Answer: X gets fat ----

What is the motivation for the next event?X had a big meal. 
---Answer: X wants to eat ----

What are your feelings after the following event?X had a big meal. 
---Answer: X tastes good ----

Runs of svjack comet-atomic-en on huggingface.co

41
Total runs
-1
24-hour runs
0
3-day runs
-9
7-day runs
-83
30-day runs

More Information About comet-atomic-en huggingface.co Model

comet-atomic-en huggingface.co

comet-atomic-en huggingface.co is an AI model on huggingface.co that provides comet-atomic-en's model effect (), which can be used instantly with this svjack comet-atomic-en model. huggingface.co supports a free trial of the comet-atomic-en model, and also provides paid use of the comet-atomic-en. Support call comet-atomic-en model through api, including Node.js, Python, http.

comet-atomic-en huggingface.co Url

https://huggingface.co/svjack/comet-atomic-en

svjack comet-atomic-en online free

comet-atomic-en huggingface.co is an online trial and call api platform, which integrates comet-atomic-en's modeling effects, including api services, and provides a free online trial of comet-atomic-en, you can try comet-atomic-en online for free by clicking the link below.

svjack comet-atomic-en online free url in huggingface.co:

https://huggingface.co/svjack/comet-atomic-en

comet-atomic-en install

comet-atomic-en is an open source model from GitHub that offers a free installation service, and any user can find comet-atomic-en on GitHub to install. At the same time, huggingface.co provides the effect of comet-atomic-en install, users can directly use comet-atomic-en installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

comet-atomic-en install url in huggingface.co:

https://huggingface.co/svjack/comet-atomic-en

Url of comet-atomic-en

comet-atomic-en huggingface.co Url

Provider of comet-atomic-en huggingface.co

svjack
ORGANIZATIONS

Other API from svjack

huggingface.co

Total runs: 20
Run Growth: 13
Growth Rate: 65.00%
Updated:February 23 2024
huggingface.co

Total runs: 14
Run Growth: 7
Growth Rate: 50.00%
Updated:February 20 2023
huggingface.co

Total runs: 2
Run Growth: 0
Growth Rate: 0.00%
Updated:March 05 2024