Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -21,11 +21,6 @@ pth_path = config.pth_path
|
|
21 |
config_json = config.config_json
|
22 |
net_g_ms, hps = infer.load_model(config_json, pth_path)
|
23 |
|
24 |
-
def trim(s):
|
25 |
-
import re
|
26 |
-
if s.startswith(' ') or s.endswith(' '):
|
27 |
-
return re.sub(r"^(\s+)|(\s+)$", "", s)
|
28 |
-
return s
|
29 |
|
30 |
# ChatGPT
|
31 |
def chat_hf(audio, custom_token, language):
|
@@ -80,7 +75,7 @@ def openai_create(prompt):
|
|
80 |
presence_penalty=0.6,
|
81 |
stop=[" Human:", " AI:"]
|
82 |
)
|
83 |
-
text_out = response.choices[0].text.strip()
|
84 |
print(text_out)
|
85 |
return text_out
|
86 |
|
|
|
21 |
config_json = config.config_json
|
22 |
net_g_ms, hps = infer.load_model(config_json, pth_path)
|
23 |
|
|
|
|
|
|
|
|
|
|
|
24 |
|
25 |
# ChatGPT
|
26 |
def chat_hf(audio, custom_token, language):
|
|
|
75 |
presence_penalty=0.6,
|
76 |
stop=[" Human:", " AI:"]
|
77 |
)
|
78 |
+
text_out = response.choices[0].text.strip().replace(' ', '').replace('\n', '').replace('\r', '')
|
79 |
print(text_out)
|
80 |
return text_out
|
81 |
|