svjack / comet-atomic-zh

huggingface.co
Total runs: 13
24-hour runs: 0
7-day runs: 1
30-day runs: 5
Model's Last Updated: February 22 2023
text-generation

Introduction of comet-atomic-zh

Model Details of comet-atomic-zh

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

NEED_PREFIX = '以下事件有哪些必要的先决条件:'
EFFECT_PREFIX = '下面的事件发生后可能会发生什么:'
INTENT_PREFIX = '以下事件的动机是什么:'
REACT_PREFIX = '以下事件发生后,你有什么感觉:'

event = "X吃了一顿美餐。"
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---答案:", decoded, "----\n")

以下事件有哪些必要的先决条件:X吃了一顿美餐。 
---答案: X买了食物 ----

下面的事件发生后可能会发生什么:X吃了一顿美餐。 
---答案: X会吃到好的食物 ----

以下事件的动机是什么:X吃了一顿美餐。 
---答案: X想吃东西 ----

以下事件发生后,你有什么感觉:X吃了一顿美餐。 
---答案: X的味道很好 ----

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

13
Total runs
0
24-hour runs
0
3-day runs
1
7-day runs
5
30-day runs

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

comet-atomic-zh huggingface.co

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

comet-atomic-zh huggingface.co Url

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

svjack comet-atomic-zh online free

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

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

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

comet-atomic-zh install

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

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

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

Url of comet-atomic-zh

comet-atomic-zh huggingface.co Url

Provider of comet-atomic-zh huggingface.co

svjack
ORGANIZATIONS

Other API from svjack

huggingface.co

Total runs: 25
Run Growth: 24
Growth Rate: 96.00%
Updated:February 23 2024
huggingface.co

Total runs: 12
Run Growth: 4
Growth Rate: 33.33%
Updated:February 20 2023
huggingface.co

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