Update app.py
Browse files
app.py
CHANGED
|
@@ -15,9 +15,9 @@ def chat(refrence: str, passage: str) -> str:
|
|
| 15 |
"""
|
| 16 |
text = f"Read the following references:\n{refrence}\nPlease identify all the errors in the following text using the information in the references provided and suggest edits if necessary:\n[Text] {passage}\n[Edited] "
|
| 17 |
outputs = pipe(text)
|
| 18 |
-
print(
|
| 19 |
-
|
| 20 |
-
output =
|
| 21 |
output = output.replace("</mark>", " </span>")
|
| 22 |
output = output.replace("<delete>", "<span style='color: red; text-decoration: line-through;'>")
|
| 23 |
output = output.replace("</delete>", "</span>")
|
|
|
|
| 15 |
"""
|
| 16 |
text = f"Read the following references:\n{refrence}\nPlease identify all the errors in the following text using the information in the references provided and suggest edits if necessary:\n[Text] {passage}\n[Edited] "
|
| 17 |
outputs = pipe(text)
|
| 18 |
+
print(outputs)
|
| 19 |
+
output = outputs[0]['generated_output'][0]
|
| 20 |
+
output = output.replace("<mark>", "<span style='color: green; font-weight: bold;'> ")
|
| 21 |
output = output.replace("</mark>", " </span>")
|
| 22 |
output = output.replace("<delete>", "<span style='color: red; text-decoration: line-through;'>")
|
| 23 |
output = output.replace("</delete>", "</span>")
|