Lenylvt commited on
Commit
3ddcad8
·
verified ·
1 Parent(s): 4003638

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -74,10 +74,10 @@ def correction_dictee(dictee_utilisateur):
74
  }
75
  formatted_prompt = f"<s>[INST] {prompt} [/INST]"
76
  stream = client_hf.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
77
- texte_ameliore = ""
78
  for response in stream:
79
- texte_ameliore += response.token.text
80
- texte_ameliore = texte_ameliore.replace("</s>", "").strip()
81
  return correction
82
 
83
  def replace_punctuation(text):
 
74
  }
75
  formatted_prompt = f"<s>[INST] {prompt} [/INST]"
76
  stream = client_hf.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
77
+ correction = ""
78
  for response in stream:
79
+ correction += response.token.text
80
+ correction = correction.replace("</s>", "").strip()
81
  return correction
82
 
83
  def replace_punctuation(text):