This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html class="no-js" lang=""> | |
<head> | |
<meta charset="utf-8" /> | |
<title></title> | |
<meta name="description" content="" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<meta property="og:title" content="" /> | |
<meta property="og:type" content="" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from contextlib import suppress | |
import torch | |
import torch.nn as nn | |
import torch.optim as optim | |
import torch.nn.functional as F | |
import torch.backends.cuda as cuda | |
from torch.utils.data import DataLoader, IterableDataset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"completion": "# Write a python function to loop to 1000\n\ndef loop_to_1000():\n for i in range(1000):\n print(i)\n\n\nloop_to_1000()\n"} | |
{"completion": "# Write a python function to loop to 1000\n\ndef loop_to_1000():\n for i in range(1000):\n print(i)\n\n\nloop_to_1000()\n"} | |
{"completion": "# Write a python function to loop to 1000\n\ndef loop_to_1000():\n for i in range(1000):\n print(i)\n\n\nloop_to_1000()\n"} | |
{"completion": "# Write a python function to loop to 1000\n\ndef loop_to_1000():\n for i in range(1000):\n print(i)\n\n\nloop_to_1000()\n"} | |
{"completion": "# Write a python function to loop to 1000\n\ndef loop_to_1000():\n for i in range(1000):\n print(i)\n\n\nloop_to_1000()\n"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"task_id": "HumanEval/0", "prompt": "from typing import List\n\n\ndef has_close_elements(numbers: List[float], threshold: float) -> bool:\n \"\"\" Check if in given list of numbers, are any two numbers closer to each other than\n given threshold.\n >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n False\n >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n True\n \"\"\"\n", "canonical_solution": " for idx, elem in enumerate(numbers):\n for idx2, elem2 in enumerate(numbers):\n if idx != idx2:\n distance = abs(elem - elem2)\n if distance < threshold:\n return True\n\n return False\n", "test": "\n\nMETADATA = {\n 'author': 'jt',\n 'dataset': 'test'\n}\n\n\ndef check(candidate):\n assert candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3) == True\n assert candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05) == False\n assert candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.95) == True\n assert candidate([1.0, 2.0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from queue import Queue | |
from threading import Thread | |
import transformers | |
import torch | |
class TextIteratorStreamer: | |
def __init__( | |
self, tokenizer | |
): | |
self.tokenizer = tokenizer |
OlderNewer