Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,7 +17,7 @@ from chromadb.utils import embedding_functions
|
|
| 17 |
# Define the device
|
| 18 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 19 |
|
| 20 |
-
model_name = "
|
| 21 |
|
| 22 |
llm = LLM(model_name, max_model_len=8128)
|
| 23 |
|
|
@@ -80,10 +80,9 @@ def generate_html_diff(old_text, new_text):
|
|
| 80 |
for word in diff:
|
| 81 |
if word.startswith(' '):
|
| 82 |
html_diff.append(word[2:])
|
| 83 |
-
elif word.startswith('- '):
|
| 84 |
-
html_diff.append(f'<span style="background-color: #ffcccb; text-decoration: line-through;">{word[2:]}</span>')
|
| 85 |
elif word.startswith('+ '):
|
| 86 |
html_diff.append(f'<span style="background-color: #90EE90;">{word[2:]}</span>')
|
|
|
|
| 87 |
|
| 88 |
return ' '.join(html_diff)
|
| 89 |
|
|
|
|
| 17 |
# Define the device
|
| 18 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 19 |
|
| 20 |
+
model_name = "Pclanglais/ocronos2"
|
| 21 |
|
| 22 |
llm = LLM(model_name, max_model_len=8128)
|
| 23 |
|
|
|
|
| 80 |
for word in diff:
|
| 81 |
if word.startswith(' '):
|
| 82 |
html_diff.append(word[2:])
|
|
|
|
|
|
|
| 83 |
elif word.startswith('+ '):
|
| 84 |
html_diff.append(f'<span style="background-color: #90EE90;">{word[2:]}</span>')
|
| 85 |
+
# We're not adding anything for words that start with '- '
|
| 86 |
|
| 87 |
return ' '.join(html_diff)
|
| 88 |
|