mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-04-19 22:02:06 +00:00
* Attempt at automatic max batch prefill. * Taking into account number of shards. * Adding more cards. * Adding A100 + H100 * Adding a few more cards. * Logprobs cost too much. * h100 better name, and keep factor of 2 * Damn inflated sparse tflops. * Typo in h100. * Updated the flops calculation (checked with fvcore). * chunking by default. * Fix prefix caching for chat completion since we removed logprobs. * More tests. * Dropping all the prefill logprobs. * Add a flag that enables users to get logprobs back. * Repairing prompt token counting. * Fixing a few tests. * Remove some scaffolding. * Attempting to reduces the issues (workarounds for now).
28 lines
701 B
Python
28 lines
701 B
Python
import json
|
|
import datasets
|
|
import tqdm
|
|
|
|
|
|
def main():
|
|
dataset = datasets.load_dataset("Open-Orca/OpenOrca", split="train")
|
|
# Select only the first 2k conversations that start with a human.
|
|
max = min(2000, len(dataset))
|
|
conversations = []
|
|
for item in tqdm.tqdm(dataset, total=max):
|
|
conversation = {
|
|
"conversations": [
|
|
{"from": "human", "value": item["question"]},
|
|
],
|
|
"id": item["id"],
|
|
}
|
|
conversations.append(conversation)
|
|
if len(conversations) >= max:
|
|
break
|
|
|
|
with open("./small.json", "w") as f:
|
|
json.dump(conversations, f, indent=4)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|