Spaces:
Runtime error
Runtime error
minor
Browse files- app.py +1 -0
- test_sanitize.py +2 -0
app.py
CHANGED
@@ -27,6 +27,7 @@ def ask(model, system_prompt, pre_prompt, question):
|
|
27 |
]
|
28 |
logger.debug(f"<< {model} << {messages}")
|
29 |
response = chat(model=model, messages=messages)
|
|
|
30 |
return response['message']['content']
|
31 |
|
32 |
|
|
|
27 |
]
|
28 |
logger.debug(f"<< {model} << {messages}")
|
29 |
response = chat(model=model, messages=messages)
|
30 |
+
logger.debug(f">> {model} >> {messages}")
|
31 |
return response['message']['content']
|
32 |
|
33 |
|
test_sanitize.py
CHANGED
@@ -3,6 +3,8 @@ from app import sanitize
|
|
3 |
|
4 |
def test_sanitize():
|
5 |
assert '' == sanitize('')
|
|
|
|
|
6 |
assert 'qwertyui' == sanitize('qwertyui')
|
7 |
assert 'qwertyui ' == sanitize('qwertyui (abcdef)')
|
8 |
assert 'qwertyui poiuy' == sanitize('qwertyui (abcdef) poiuy')
|
|
|
3 |
|
4 |
def test_sanitize():
|
5 |
assert '' == sanitize('')
|
6 |
+
assert '' == sanitize('((a)')
|
7 |
+
assert '(' == sanitize('(')
|
8 |
assert 'qwertyui' == sanitize('qwertyui')
|
9 |
assert 'qwertyui ' == sanitize('qwertyui (abcdef)')
|
10 |
assert 'qwertyui poiuy' == sanitize('qwertyui (abcdef) poiuy')
|