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