Spaces:
Runtime error
Runtime error
fix: use text_generation instead of chat_completion for Mistral
Browse files- pipeline/explainer.py +5 -5
pipeline/explainer.py
CHANGED
|
@@ -39,12 +39,12 @@ class FallacyExplainer:
|
|
| 39 |
print(f"FallacyExplainer ready (model: {model_id})")
|
| 40 |
|
| 41 |
def _generate_with_prompt(self, prompt_text, max_new_tokens=128):
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
temperature=0.1,
|
| 46 |
-
|
| 47 |
-
|
| 48 |
|
| 49 |
def _load_prompt(self, path):
|
| 50 |
with open(BASE_DIR / path, "r") as f:
|
|
|
|
| 39 |
print(f"FallacyExplainer ready (model: {model_id})")
|
| 40 |
|
| 41 |
def _generate_with_prompt(self, prompt_text, max_new_tokens=128):
|
| 42 |
+
return self._client.text_generation(
|
| 43 |
+
prompt_text,
|
| 44 |
+
max_new_tokens=max_new_tokens,
|
| 45 |
temperature=0.1,
|
| 46 |
+
do_sample=True,
|
| 47 |
+
).strip()
|
| 48 |
|
| 49 |
def _load_prompt(self, path):
|
| 50 |
with open(BASE_DIR / path, "r") as f:
|