Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -78,7 +78,7 @@ async def generate_text(request: GenerateRequest = None, prompt: str = None, max
|
|
| 78 |
raw_response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 79 |
|
| 80 |
clean_response = raw_response.replace(formatted_prompt, "").strip()
|
| 81 |
-
clean_response = re.sub(r'</?s>|\[/?INST\]|\[/?INSR\]|\{/?INSST\}', '', clean_response).strip()
|
| 82 |
|
| 83 |
return {"response": clean_response}
|
| 84 |
except Exception as e:
|
|
|
|
| 78 |
raw_response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 79 |
|
| 80 |
clean_response = raw_response.replace(formatted_prompt, "").strip()
|
| 81 |
+
clean_response = re.sub(r'</?s>|\[/?s\]|\[/?INST\]|\[/?INSR\]|\{/?INSST\}', '', clean_response).strip()
|
| 82 |
|
| 83 |
return {"response": clean_response}
|
| 84 |
except Exception as e:
|