Cachoups commited on
Commit
7d505c6
·
verified ·
1 Parent(s): 173ffa8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -21,7 +21,7 @@ def preprocess_for_bm25(text):
21
  text = text.replace("...", " _ELLIPSIS_ ")
22
 
23
  # Add space before and after punctuation (except "_ELLIPSIS_")
24
- text = re.sub(r'([.,!?()"\'])', r' \1', text) # General case for punctuation
25
  #text = text.replace("'s", " 's")
26
 
27
  # Restore "..." from the placeholder
@@ -110,7 +110,7 @@ def ra(user_question):
110
  #res1 = client_bis.text_generation(f"You know things about League of Legends. Please correct the following question for grammar and clarity.Do not give explaination:\n{user_question}\nCorrected question:", stream =False,max_new_tokens= 10, temperature = 0.1 )
111
  messages_q=[
112
  #{"role": "system", "content": "You are an familiar with League of Legends. You help correct grammar and clarity without giving additional explanations."},
113
- {"role": "system", "content": f"""You are an expert in League of Legends. You correct grammar and clarity issues in questions. You only return the corrected question itself without giving additional explanations.
114
  Example:
115
  Input: whos zoe
116
  Output: Who is Zoe?
 
21
  text = text.replace("...", " _ELLIPSIS_ ")
22
 
23
  # Add space before and after punctuation (except "_ELLIPSIS_")
24
+ text = re.sub(r'([.,!?()"\'])', r' \1 ', text) # General case for punctuation
25
  #text = text.replace("'s", " 's")
26
 
27
  # Restore "..." from the placeholder
 
110
  #res1 = client_bis.text_generation(f"You know things about League of Legends. Please correct the following question for grammar and clarity.Do not give explaination:\n{user_question}\nCorrected question:", stream =False,max_new_tokens= 10, temperature = 0.1 )
111
  messages_q=[
112
  #{"role": "system", "content": "You are an familiar with League of Legends. You help correct grammar and clarity without giving additional explanations."},
113
+ {"role": "system", "content": f"""You are an expert in League of Legends. You correct grammar and clarity issues in questions. You only return the corrected question itself without giving additional explanations.
114
  Example:
115
  Input: whos zoe
116
  Output: Who is Zoe?