Spaces:
Runtime error
Runtime error
initial setup
Browse files- app.py +33 -0
- nnf_text_to_speech_v2.code-workspace +29 -0
- requirements.txt +3 -0
app.py
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import json
|
3 |
+
#from bark import SAMPLE_RATE, generate_audio, preload_models
|
4 |
+
#from bark.generation import SUPPORTED_LANGS
|
5 |
+
#from share_btn imposrt community_icon_html, loading_icon_html, share_js
|
6 |
+
#from flask import Flask, jsonify
|
7 |
+
|
8 |
+
DEBUG_MODE = False
|
9 |
+
|
10 |
+
|
11 |
+
#@app.route('/api/test1', methods=['GET'])
|
12 |
+
def endpoint1():
|
13 |
+
# Your logic for the first endpoint
|
14 |
+
#return jsonify({"message": "Endpoint 1"})
|
15 |
+
return "Endpoint 1"
|
16 |
+
|
17 |
+
|
18 |
+
def echo(text, request: gr.Request):
|
19 |
+
output_text = {"report1": "SUCCESS"} # Initialize as a dictionary
|
20 |
+
output_text["report3"] = text
|
21 |
+
if request:
|
22 |
+
# Convert headers to a dictionary and include them in the output_text
|
23 |
+
output_text["headers"] = dict(request.headers.items())
|
24 |
+
|
25 |
+
# Convert the output_text dictionary to a JSON-formatted string
|
26 |
+
|
27 |
+
#audio_out = gr.Audio(label="Generated Audio",
|
28 |
+
# type="numpy", elem_id="audio_out")
|
29 |
+
|
30 |
+
output_text_json = json.dumps(output_text)
|
31 |
+
return output_text_json
|
32 |
+
|
33 |
+
io = gr.Interface(echo, "textarea", "json").launch(share=True)
|
nnf_text_to_speech_v2.code-workspace
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"folders": [
|
3 |
+
{
|
4 |
+
"path": "."
|
5 |
+
}
|
6 |
+
],
|
7 |
+
"settings": {
|
8 |
+
"workbench.colorCustomizations": {
|
9 |
+
"activityBar.activeBackground": "#cad4df",
|
10 |
+
"activityBar.background": "#cad4df",
|
11 |
+
"activityBar.foreground": "#15202b",
|
12 |
+
"activityBar.inactiveForeground": "#15202b99",
|
13 |
+
"activityBarBadge.background": "#ab748e",
|
14 |
+
"activityBarBadge.foreground": "#15202b",
|
15 |
+
"commandCenter.border": "#15202b99",
|
16 |
+
"sash.hoverBorder": "#cad4df",
|
17 |
+
"statusBar.background": "#aabbcc",
|
18 |
+
"statusBar.foreground": "#15202b",
|
19 |
+
"statusBarItem.hoverBackground": "#8aa1b9",
|
20 |
+
"statusBarItem.remoteBackground": "#aabbcc",
|
21 |
+
"statusBarItem.remoteForeground": "#15202b",
|
22 |
+
"titleBar.activeBackground": "#aabbcc",
|
23 |
+
"titleBar.activeForeground": "#15202b",
|
24 |
+
"titleBar.inactiveBackground": "#aabbcc99",
|
25 |
+
"titleBar.inactiveForeground": "#15202b99"
|
26 |
+
},
|
27 |
+
"peacock.color": "#aabbcc"
|
28 |
+
}
|
29 |
+
}
|
requirements.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
gradio
|
2 |
+
transformers
|
3 |
+
#bark
|