Update app.py
Browse files
app.py
CHANGED
|
@@ -253,7 +253,7 @@ def generate_text(text, prompt_type):
|
|
| 253 |
return "No text provided."
|
| 254 |
|
| 255 |
prompts = {
|
| 256 |
-
"dic_clean":"this is a dictated text, domain is likely medical/gastroenterology. correct the text while maintain the tone and style but correct spelling and replace punctuation and newline wordings, follow inline corrections as dictated by the user (eg delete, replace, etc...).",
|
| 257 |
"summarize": "You are an AI assistant specialized in summarizing text. Provide a concise summary of the given text.",
|
| 258 |
"create_qa": "You are an AI assistant specialized in creating Q&A pairs. Generate relevant questions and answers based on the given text.",
|
| 259 |
"analyze": "You are an AI assistant specialized in text analysis. Analyze the main points and key ideas of the given text."
|
|
@@ -267,8 +267,8 @@ def generate_text(text, prompt_type):
|
|
| 267 |
{"role": "system", "content": selected_prompt},
|
| 268 |
{"role": "user", "content": text}
|
| 269 |
],
|
| 270 |
-
max_tokens=
|
| 271 |
-
temperature=0.
|
| 272 |
)
|
| 273 |
|
| 274 |
return response.choices[0].message.content
|
|
|
|
| 253 |
return "No text provided."
|
| 254 |
|
| 255 |
prompts = {
|
| 256 |
+
"dic_clean":"this is a dictated text, domain is likely medical/gastroenterology. correct the text while maintain the tone and style but correct spelling and replace punctuation and newline wordings, follow inline corrections as dictated by the user (eg delete, replace, etc...). pay attention to words that could have been mis transcribed during the speech to text conversion. pay attention to correct he/she throughout. if you are uncertain about something, put it in [[doube square brackets]]. ",
|
| 257 |
"summarize": "You are an AI assistant specialized in summarizing text. Provide a concise summary of the given text.",
|
| 258 |
"create_qa": "You are an AI assistant specialized in creating Q&A pairs. Generate relevant questions and answers based on the given text.",
|
| 259 |
"analyze": "You are an AI assistant specialized in text analysis. Analyze the main points and key ideas of the given text."
|
|
|
|
| 267 |
{"role": "system", "content": selected_prompt},
|
| 268 |
{"role": "user", "content": text}
|
| 269 |
],
|
| 270 |
+
max_tokens=1000,
|
| 271 |
+
temperature=0.3
|
| 272 |
)
|
| 273 |
|
| 274 |
return response.choices[0].message.content
|