Comments (4)
@renatoviolin convert them into list first and then zip it. Provide the key in sorted function. I modified the compute_pred_dict
function as follows.
raw_results_by_id = [(int(res["unique_id"] + 1), dict(res)) for res in raw_results]
# Cast example id to int32 for each example, similarly to the raw results.
sess = tf.Session()
all_candidates = candidates_dict.items()
example_ids = tf.to_int32(np.array([int(k) for k, _ in all_candidates
])).eval(session=sess)
examples_by_id = list(zip(example_ids, all_candidates))
# Cast unique_id also to int32 for features.
feature_ids = []
features = []
for f in dev_features:
feature_ids.append(f.features.feature["unique_ids"].int64_list.value[0] + 1)
features.append(dict(f.features.feature))
feature_ids = tf.to_int32(np.array(feature_ids)).eval(session=sess)
features_by_id = list(zip(feature_ids, features))
# Join examplew with features and raw results.
examples = []
merged = sorted(examples_by_id + raw_results_by_id + features_by_id, key=lambda x: x[0])
from language.
@graviraja did you manage to solve this issue? This is because you're probably using python3. I got over it changing a couple of lines, there are other python3 issues. For this one just replace "r" with "rb" in
lines 865 and 867. The reason why is here. I meant in run_nq.py
from language.
@gisvl yes i solved it. Thank you for your input.
from language.
@graviraja How did you solve the "TypeError: unsupported operand type(s) for +: 'zip' and 'list'" ?
I tried to cast to list, but fails inside sorted.
I remove the sorted and fails at end predictions.
from language.
Related Issues (20)
- NQ Tiny Dev BucketNotFoundException
- Chines
- BERT EXTRACTION: Unable to get the result
- Benchmarking performance on TempLAMA and CustomNews
- XSP data downloading: no access
- The problem of obtaining the FRUIT dataset.
- The work: RGF: Retrieval-guided Counterfactual Generation for QA is so abstractive, is it convenient for you to update the code? Thank you so much! HOT 2
- Realm usage
- [NQG] AssertionError: Found 392 Python objects that were not bound to checkpointed values
- Is it convenient for you to share source codes of FROST?
- OSError: [E053] Could not read config.cfg from en_core_web_md-3.0.0a1/config.cfg
- CANINE Pretraining Code (pt.2)
- Bard is repetitively and wilfully lie
- Help migrating away from ORES
- Inquiry about checkpoint of ORQA
- Practice
- Bard - inability to read, analyze, and summarize websites
- T
- ORQA fine tuning with REALM pre-training: is it possible to run the fine tuning on Google Colab GPU?
- Français
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 language.