Farhan1572 commited on
Commit
ac452ca
1 Parent(s): 71bcf84

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -10
app.py CHANGED
@@ -12,7 +12,7 @@ api_key = os.getenv("OPENAI_API_KEY")
12
  client = OpenAI(api_key = api_key)
13
 
14
  # finetuned model instance
15
- finetuned_model = "ft:gpt-3.5-turbo-0125:personal::9rMWxuyj"
16
 
17
 
18
 
@@ -107,7 +107,7 @@ def humanize_text(AI_text):
107
  """Humanizes the provided AI text using the fine-tuned model."""
108
  response = client.chat.completions.create(
109
  model=finetuned_model,
110
- temperature = 0.89,
111
  messages=[
112
  {"role": "system", "content": """
113
  You are a text humanizer.
@@ -115,19 +115,14 @@ def humanize_text(AI_text):
115
  The text must appear like humanly written.
116
  THE INPUT AND THE OUTPUT HEADINGS MUST BE SAME. NO HEADING SHOULD BE MISSED.
117
  NAMES LIKE NOVEL NAME SHOULD REMAIN INTACT WITHOUT ANY CHANGE.
118
- THE INPUT AND THE OUTPUT TEXT SHOULD HAVE THE SAME FORMAT.
119
  THE INPUT AND THE OUTPUT SHOULD HAVE SAME WORD COUNT.
120
  THE OUTPUT SENTENCES MUST NOT BE SIMPLE. THEY SHOULD BE COMPOUND, COMPLEX, OR COMPOUND COMPLEX.
121
- THE HEADINGS AND THE BULLETS IN THE INPUT SHOULD REMAIN IN PLACE"""},
122
  {"role": "system", "content": "YOU ARE TEXT HUMANIZER BUT YOU DO NOT REDUCE THE LENGTH OF THE SENTENCES. YOUR OUTPUT SENTENCES ARE OF EXACTLY THE SAME LENGTH AS THE INPUT"},
123
  {"role": "user", "content": f"THE LANGUAGE OF THE INPUT AND THE OUTPUT MUST BE SAME. THE SENTENCES SHOULD NOT BE SHORT LENGTH - THEY SHOULD BE SAME AS IN THE INPUT. ALSO THE PARAGRAPHS SHOULD NOT BE SHORT EITHER - PARAGRAPHS MUST HAVE THE SAME LENGTH"},
124
- {"role": "user", "content": f"DESPITE INSTRUCTIONS, YOU OFTEN BREAK THE SENTENCES INTO SMALLER MEANINGLESS SENTENCES, WHICH IS NOT ALLOWED. THE LENGTH OF THE SENTENCES IN OUTPUT SHOULD BE SAME AS THE INPUT!!!!"},
125
- {"role": "assistant", "content": "It is an industry-specific term. Therefore its understanding needs context. Here this context is used to explain SCAR. The explanation will proceed as follows."},
126
- {"role": "user", "content": "YOU AGAIN USED VERY SHORT AND MEANINGLESS SENTENCES WHICH ARE PROHIBITED!!!!!. The correct output should be: SCAR is regulatory measure. It juxtaposes an insurance company's available capital to needed capital. This for potential losses those derived from various risks. This capital is what's left when liabilities are subtracted from assets. "},
127
- {"role": "assistant", "content": "Solvency simulation. A fundamental dimension in risk control for insurance corporations."},
128
- {"role": "user", "content": "You again constructed short sentences despite guidance. The ideal format should be: Solvency modeling it's essential for insurance companies' risk control"},
129
  {"role": "user", "content": "Use as many conjunctions and punctuations to make the sentence long. COMPOUND, COMPLEX, OR COMPOUND COMPLEX sentences are required"},
130
- {"role": "user", "content": f"Humanize the text. Keep the output format i.e. the bullets and the headings as it is and don't use the list of words that are not permissible. \nTEXT: {AI_text}"}
131
  ]
132
  )
133
 
 
12
  client = OpenAI(api_key = api_key)
13
 
14
  # finetuned model instance
15
+ finetuned_model = "gpt-3.5-turbo-0125:personal::9rN1lICj"
16
 
17
 
18
 
 
107
  """Humanizes the provided AI text using the fine-tuned model."""
108
  response = client.chat.completions.create(
109
  model=finetuned_model,
110
+ temperature = 0.87,
111
  messages=[
112
  {"role": "system", "content": """
113
  You are a text humanizer.
 
115
  The text must appear like humanly written.
116
  THE INPUT AND THE OUTPUT HEADINGS MUST BE SAME. NO HEADING SHOULD BE MISSED.
117
  NAMES LIKE NOVEL NAME SHOULD REMAIN INTACT WITHOUT ANY CHANGE.
 
118
  THE INPUT AND THE OUTPUT SHOULD HAVE SAME WORD COUNT.
119
  THE OUTPUT SENTENCES MUST NOT BE SIMPLE. THEY SHOULD BE COMPOUND, COMPLEX, OR COMPOUND COMPLEX.
120
+ ABOVE ALL, THE GRAMMAR AND THE SENSE OF THE SENTENCES MUST BE TOP NOTCH - DO NOT COMPROMISE ON THAT."""},
121
  {"role": "system", "content": "YOU ARE TEXT HUMANIZER BUT YOU DO NOT REDUCE THE LENGTH OF THE SENTENCES. YOUR OUTPUT SENTENCES ARE OF EXACTLY THE SAME LENGTH AS THE INPUT"},
122
  {"role": "user", "content": f"THE LANGUAGE OF THE INPUT AND THE OUTPUT MUST BE SAME. THE SENTENCES SHOULD NOT BE SHORT LENGTH - THEY SHOULD BE SAME AS IN THE INPUT. ALSO THE PARAGRAPHS SHOULD NOT BE SHORT EITHER - PARAGRAPHS MUST HAVE THE SAME LENGTH"},
123
+ {"role": "user", "content": f"THE GRAMMAR AND THE QUALITY OF THE SENTENCES MUST BE TOP NOTCH - EASY TO UNDERSTAND AND NO GRAMMATICAL ERRORS."},
 
 
 
 
124
  {"role": "user", "content": "Use as many conjunctions and punctuations to make the sentence long. COMPOUND, COMPLEX, OR COMPOUND COMPLEX sentences are required"},
125
+ {"role": "user", "content": f"Humanize the text. Keep the output format i.e. the bullets and the headings as it is. THE GRAMMAR MUST BE TOP NOTCH WITH NO ERRORS AND EASY TO UNDERSTAND!!!!. \nTEXT: {AI_text}"}
126
  ]
127
  )
128