Update app.py
Browse files
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 |
-
|
78 |
for response in stream:
|
79 |
-
|
80 |
-
|
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):
|