ranamhamoud commited on
Commit
6344212
·
verified ·
1 Parent(s): b44c8d6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -7
app.py CHANGED
@@ -12,7 +12,7 @@ import requests
12
 
13
  # Constants
14
  MAX_MAX_NEW_TOKENS = 2048
15
- DEFAULT_MAX_NEW_TOKENS = 1024
16
  MAX_INPUT_TOKEN_LENGTH = int(os.getenv("MAX_INPUT_TOKEN_LENGTH", "4096"))
17
 
18
  # Description and License Texts
@@ -57,16 +57,11 @@ class Story(Document):
57
  # Utility function for prompts
58
  def make_prompt(entry):
59
  return f"### Human, Don't answer inappropriate messages:{entry} ### Assistant:"
60
- # f"TELL A STORY, RELATE TO COMPUTER SCIENCE, INCLUDE ASSESMENTS. MAKE IT REALISTIC AND AROUND 800 WORDS, END THE STORY WITH "THE END.": {entry}"
61
 
62
 
63
  def process_text(text):
64
- text = re.sub(r'\[assessment;[^\]]*\]', '', text, flags=re.DOTALL)
65
- text = re.sub(r'\[assessment;.*?\]', '', text, flags=re.DOTALL)
66
-
67
-
68
  text = re.sub(r'\[.*?\]', '', text, flags=re.DOTALL)
69
-
70
  return text
71
 
72
  def contains_profanity(text, profanity_set):
 
12
 
13
  # Constants
14
  MAX_MAX_NEW_TOKENS = 2048
15
+ DEFAULT_MAX_NEW_TOKENS = 500
16
  MAX_INPUT_TOKEN_LENGTH = int(os.getenv("MAX_INPUT_TOKEN_LENGTH", "4096"))
17
 
18
  # Description and License Texts
 
57
  # Utility function for prompts
58
  def make_prompt(entry):
59
  return f"### Human, Don't answer inappropriate messages:{entry} ### Assistant:"
60
+ # f"TELL A STORY, RELATE TO COMPUTER SCIENCE, INCLUDE ASSESMENTS. MAKE IT REALISTIC AND AROUND 500 WORDS, END THE STORY WITH "THE END.": {entry}"
61
 
62
 
63
  def process_text(text):
 
 
 
 
64
  text = re.sub(r'\[.*?\]', '', text, flags=re.DOTALL)
 
65
  return text
66
 
67
  def contains_profanity(text, profanity_set):