Spaces:
Runtime error
Runtime error
peter szemraj
commited on
Commit
•
63bb54c
1
Parent(s):
91e513f
:construction: minor robustness things
Browse files
app.py
CHANGED
@@ -31,7 +31,7 @@ import nltk
|
|
31 |
from utils import (
|
32 |
remove_repeated_words,
|
33 |
remove_trailing_punctuation,
|
34 |
-
|
35 |
corr,
|
36 |
)
|
37 |
|
@@ -73,7 +73,7 @@ def ask_gpt(message: str):
|
|
73 |
[str]: [model response as a string]
|
74 |
"""
|
75 |
st = time.perf_counter()
|
76 |
-
prompt =
|
77 |
prompt = prompt.strip() # get rid of any extra whitespace
|
78 |
if len(prompt) > 200:
|
79 |
prompt = prompt[-200:] # truncate
|
|
|
31 |
from utils import (
|
32 |
remove_repeated_words,
|
33 |
remove_trailing_punctuation,
|
34 |
+
cleantxt_wrap,
|
35 |
corr,
|
36 |
)
|
37 |
|
|
|
73 |
[str]: [model response as a string]
|
74 |
"""
|
75 |
st = time.perf_counter()
|
76 |
+
prompt = cleantxt_wrap(message) # clean user input
|
77 |
prompt = prompt.strip() # get rid of any extra whitespace
|
78 |
if len(prompt) > 200:
|
79 |
prompt = prompt[-200:] # truncate
|