Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -293,9 +293,9 @@ def http_bot(state, temperature, top_p, max_new_tokens, speaker):
|
|
| 293 |
output += "}"
|
| 294 |
info_dict = json.loads(output)
|
| 295 |
content_unit = info_dict['assistant response speech'].replace('<|speech_', '').replace('|>', ' ').strip()
|
| 296 |
-
emotion = info_dict['assistant response emotion'] if
|
| 297 |
-
speed = info_dict['assistant response speed'] if
|
| 298 |
-
pitch = info_dict['assistant response pitch'] if
|
| 299 |
gender = speaker.lower() if speaker else 'female'
|
| 300 |
except:
|
| 301 |
content_unit = output.replace('<|speech_', '').replace('|>', ' ').strip()
|
|
|
|
| 293 |
output += "}"
|
| 294 |
info_dict = json.loads(output)
|
| 295 |
content_unit = info_dict['assistant response speech'].replace('<|speech_', '').replace('|>', ' ').strip()
|
| 296 |
+
emotion = info_dict['assistant response emotion'] if 'assistant response emotion' in info_dict else "neutral"
|
| 297 |
+
speed = info_dict['assistant response speed'] if 'assistant response speed' in info_dict else "normal"
|
| 298 |
+
pitch = info_dict['assistant response pitch'] if 'assistant response pitch' in info_dict else "normal"
|
| 299 |
gender = speaker.lower() if speaker else 'female'
|
| 300 |
except:
|
| 301 |
content_unit = output.replace('<|speech_', '').replace('|>', ' ').strip()
|