Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -44,8 +44,9 @@ def mbti(x):
|
|
44 |
|
45 |
def chat(x):
|
46 |
x = f"{x}"
|
|
|
47 |
result = gradio_client.predict(
|
48 |
-
x
|
49 |
# str representing input in 'User input' Textbox component
|
50 |
0.92, # float, representing input in 'Top-p (nucleus sampling)' Slider component
|
51 |
40, # int, representing input in 'Top-k (nucleus sampling)' Slider component
|
@@ -59,7 +60,6 @@ def chat(x):
|
|
59 |
output = re.sub('νν','γ
γ
', output)
|
60 |
output = output.split('λ')[0]
|
61 |
output = output.split('<|endoftext|>')[0]
|
62 |
-
output = output.split('\n')[0]
|
63 |
output = re.sub('[=+#/\:@*\"β»γγβ|\\\<\>\(\)\[\]`\'β¦γ\β\β\βΒ·]', ' ', output)
|
64 |
output = re.sub('[a-zA-Z]',' ',output)
|
65 |
|
|
|
44 |
|
45 |
def chat(x):
|
46 |
x = f"{x}"
|
47 |
+
x = x.replace('friend','Human').replace('you','Assistant')
|
48 |
result = gradio_client.predict(
|
49 |
+
x,
|
50 |
# str representing input in 'User input' Textbox component
|
51 |
0.92, # float, representing input in 'Top-p (nucleus sampling)' Slider component
|
52 |
40, # int, representing input in 'Top-k (nucleus sampling)' Slider component
|
|
|
60 |
output = re.sub('νν','γ
γ
', output)
|
61 |
output = output.split('λ')[0]
|
62 |
output = output.split('<|endoftext|>')[0]
|
|
|
63 |
output = re.sub('[=+#/\:@*\"β»γγβ|\\\<\>\(\)\[\]`\'β¦γ\β\β\βΒ·]', ' ', output)
|
64 |
output = re.sub('[a-zA-Z]',' ',output)
|
65 |
|