mirror of
https://github.com/princeton-nlp/tree-of-thought-llm
synced 2025-04-16 21:41:16 +00:00
initial work with SWETask
This commit is contained in:
parent
025fe57daf
commit
f9900e798c
@ -1,27 +1,20 @@
|
||||
import os
|
||||
import re
|
||||
from tot.tasks.base import Task, DATA_PATH
|
||||
from tot.tasks.base import Task
|
||||
from tot.prompts.text import *
|
||||
from tot.models import gpt
|
||||
|
||||
|
||||
|
||||
|
||||
class SWETask(Task):
|
||||
"""
|
||||
Input (x) : a text instruction
|
||||
Input (x) : a task instruction
|
||||
Output (y) : a text generation
|
||||
Reward (r) : # TODO
|
||||
Input Example:
|
||||
Output Example:
|
||||
"""
|
||||
def __init__(self, file='data_100_random_text.txt'):
|
||||
def __init__(self, dataset):
|
||||
"""
|
||||
file: a text file, each line is some sentences
|
||||
"""
|
||||
super().__init__()
|
||||
path = os.path.join(DATA_PATH, 'text', file)
|
||||
self.data = open(path).readlines()
|
||||
self.data = dataset
|
||||
self.steps = 2
|
||||
self.stops = ['\nPassage:\n', None]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user