Commit 82d57f65 authored by lintangsutawika's avatar lintangsutawika
Browse files

process condition for doc_to_text

parent e9432fad
...@@ -38,7 +38,14 @@ class Sampler: ...@@ -38,7 +38,14 @@ class Sampler:
self.fewshot_delimiter.join( self.fewshot_delimiter.join(
[ [
# TODO: is separating doc_to_text and doc_to_target by one space always desired? # TODO: is separating doc_to_text and doc_to_target by one space always desired?
self.doc_to_text(doc) (
self.doc_to_text(doc)
if (
self.config.doc_to_choice is None
or type(self.doc_to_text(doc)) is str
)
else self.doc_to_choice(doc)[self.doc_to_text(doc)]
)
+ self.target_delimiter + self.target_delimiter
+ ( + (
self.doc_to_target(doc) self.doc_to_target(doc)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment