Git Product home page Git Product logo

Comments (16)

dshwei avatar dshwei commented on May 29, 2024
def get_input_tokens(self, bsz, spots, asocs):
    input_tokens = self.prompt_inputs.unsqueeze(0).expand(bsz, -1)**.clone().**to(self.t5.device)
    spots_len = len(spots[0])

    input_tokens[:, 0] = 1
    input_tokens[:, 1] = 2
    input_tokens[:, 2] = 3
    start_pos = 3
    for i, spot in enumerate(spots):
        for j, s in enumerate(spot, start = start_pos):
            input_tokens[i, j] = self.get_prompt_ids(tuple(s))
    input_tokens[:, start_pos + spots_len] = 3

    input_tokens[:, start_pos + 1 + spots_len] = 4
    start_pos = 5 + spots_len
    for i, asoc in enumerate(asocs):
        for j, a in enumerate(asoc, start = start_pos):
            input_tokens[i, j] = self.get_prompt_ids(tuple(a))
    input_tokens[:, 5 + spots_len + len(asocs[0])] = 4

    return input_tokens

self.prompt_inputs.unsqueeze(0).expand(bsz, -1).**clone().**to(self.t5.device) 要 .clone()

from adakgc.

guihonghao avatar guihonghao commented on May 29, 2024

感谢你的提醒,我们已对相应的代码进行了修改。

from adakgc.

zxlzr avatar zxlzr commented on May 29, 2024

hi, have you solved your issue?

from adakgc.

dshwei avatar dshwei commented on May 29, 2024

from adakgc.

dshwei avatar dshwei commented on May 29, 2024

from adakgc.

guihonghao avatar guihonghao commented on May 29, 2024

bash scripts/run_prompt.bash --model=hf_models/mix --data=data/${data_name}${mode}/iter_1 --output=output/${data_name}${mode}${ratio} --config=${data_name}.ini --device=${device} --negative_ratio=${ratio} --record2=data/${data_name}${mode}/iter_7/record.schema训练后保存的模型地址是--output=output/${data_name}${mode}${ratio},因此在推理时也是output

from adakgc.

dshwei avatar dshwei commented on May 29, 2024

from adakgc.

dshwei avatar dshwei commented on May 29, 2024

from adakgc.

guihonghao avatar guihonghao commented on May 29, 2024

A800 batch_size设置大一些,应该跑起来很快。

from adakgc.

dshwei avatar dshwei commented on May 29, 2024

from adakgc.

guihonghao avatar guihonghao commented on May 29, 2024

https://nlp.stanford.edu/data/glove.6B.zip

from adakgc.

dshwei avatar dshwei commented on May 29, 2024

from adakgc.

guihonghao avatar guihonghao commented on May 29, 2024

序列长度超出了最大长度512需要截断。

from adakgc.

dshwei avatar dshwei commented on May 29, 2024

from adakgc.

dshwei avatar dshwei commented on May 29, 2024

from adakgc.

guihonghao avatar guihonghao commented on May 29, 2024

看不到截图,你可以加我的微信ghh200002

from adakgc.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.