Views
No views yet
python gpu_experiment.py /app/litm/results_gpu Qwen/Qwen2.5-0.5B-Instruct 50 501python run_kv_gpu.py \
2 --data-path kv_data_50.jsonl \
3 --num-keys 50 \
4 --model Qwen/Qwen2.5-0.5B-Instruct \
5 --output-dir results_gpu \
6 --max-examples 501export OPENAI_API_KEY=sk-...
2python run_openai.py \
3 --data-path kv_data_50.jsonl \
4 --num-keys 50 \
5 --model gpt-3.5-turbo \
6 --max-examples 50| Gold Position | Accuracy |
|---|---|
| 0 (start) | 1.00 |
| 2 | 0.60 |
| 5 (middle) | 1.00 |
| 7 | 0.80 |
| 9 (end) | 0.60 |
Extract the value corresponding to the specified key in the JSON object below.
JSON data:
{"<key1>": "<value1>",
"<key2>": "<value2>",
...}
Key: "<query_key>"
Corresponding value:1@article{liu2023lost,
2 title={Lost in the Middle: How Language Models Use Long Contexts},
3 author={Liu, Nelson F and Lin, Kevin and Hewitt, John and Paranjape, Ashwin and Bevilacqua, Michele and Petroni, Fabio and Liang, Percy},
4 journal={arXiv preprint arXiv:2307.03172},
5 year={2023}
6}1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_id = "abhshkp/lost-in-the-middle-reproduction"
4tokenizer = AutoTokenizer.from_pretrained(model_id)
5model = AutoModelForCausalLM.from_pretrained(model_id)AutoModelForCausalLM with the appropriate AutoModel class.