Skip to content

Commit e9af499

Browse files
committed
Add T5 integration test script; T5 model confirmed working with GPU, but formatting guardrails recommended
1 parent 66abf32 commit e9af499

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

run_t5_test.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from pipeline.filters.t5_grammar_filter import T5GrammarFilter
2+
3+
text = '''i dont even know why im writting this lol, like its 3am an my brain wont stop spinning 🤦‍♀️ everything feels like a movie but the kind that got low budget n no one showed up. he said he loved me but then he left like two minits later?? idk maybe its me or maybe ppl just like drama more than peace. anyways im sittin here eatin cold pizza an thinkin abt the way his eyes use to glow in the dark (prolly cuz of the phone screen but whatever).
4+
5+
my freind jess keeps texting me sayin “girl u deserve better” but she also dated that dude with the skull tat n 3 baby mamas so who even listens anymore 😂. i tried to write a poem but it turned into like a rant?? here it goes:
6+
7+
roses are red
8+
my phone is broke
9+
ur name on my screen
10+
was a cosmic joke
11+
12+
idc if that dont rhyme im not a english teacher okay. i just wanna sleep but also i dont want tomorrow to come cuz then its monday an mondays r like emotional hangovers.'''
13+
14+
def main():
15+
print("Loading T5 model (this may take a while on first run)...")
16+
t5_filter = T5GrammarFilter()
17+
print("\nOriginal text:\n")
18+
print(text)
19+
print("\nCorrected text:\n")
20+
corrected = t5_filter.correct_text(text)
21+
print(corrected)
22+
23+
if __name__ == "__main__":
24+
main()

0 commit comments

Comments
 (0)