Comments (16)
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.
感谢你的提醒,我们已对相应的代码进行了修改。
from adakgc.
hi, have you solved your issue?
from adakgc.
from adakgc.
from adakgc.
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.
from adakgc.
from adakgc.
A800 batch_size设置大一些,应该跑起来很快。
from adakgc.
from adakgc.
https://nlp.stanford.edu/data/glove.6B.zip
from adakgc.
from adakgc.
序列长度超出了最大长度512需要截断。
from adakgc.
from adakgc.
from adakgc.
看不到截图,你可以加我的微信ghh200002
from adakgc.
Related Issues (5)
- HF_DATASETS_CACHE的数据问题 HOT 1
- trainer.py报错 HOT 5
- 多卡运行报错 HOT 1
- 代码运行后F1值异常 HOT 15
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adakgc.