Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
import chat
|
| 2 |
import gradio
|
|
|
|
| 3 |
|
| 4 |
def initialize_game(game_id, user_id, user_input):
|
| 5 |
result = chat.initialize_game(game_id, user_id, user_input)
|
|
@@ -16,6 +17,10 @@ def health_check(name):
|
|
| 16 |
def generate_image_prompt(game_id, user_id, user_input):
|
| 17 |
result = chat.generate_image_prompt(game_id, user_id, user_input)
|
| 18 |
return result
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
# @app.route('/load_game', methods=['GET'])
|
| 21 |
# def load_game():
|
|
@@ -55,5 +60,12 @@ generate_image_prompt_gr = gradio.Interface(
|
|
| 55 |
description="An API for the user to generate a prompt to input to Leo"
|
| 56 |
)
|
| 57 |
|
| 58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
genesis_app.launch()
|
|
|
|
| 1 |
import chat
|
| 2 |
import gradio
|
| 3 |
+
import audio
|
| 4 |
|
| 5 |
def initialize_game(game_id, user_id, user_input):
|
| 6 |
result = chat.initialize_game(game_id, user_id, user_input)
|
|
|
|
| 17 |
def generate_image_prompt(game_id, user_id, user_input):
|
| 18 |
result = chat.generate_image_prompt(game_id, user_id, user_input)
|
| 19 |
return result
|
| 20 |
+
|
| 21 |
+
def generate_audio(input_text):
|
| 22 |
+
result = audio.generate_audio(input_text)
|
| 23 |
+
return result
|
| 24 |
|
| 25 |
# @app.route('/load_game', methods=['GET'])
|
| 26 |
# def load_game():
|
|
|
|
| 60 |
description="An API for the user to generate a prompt to input to Leo"
|
| 61 |
)
|
| 62 |
|
| 63 |
+
generate_audio_gr = gradio.Interface(
|
| 64 |
+
fn=generate_audio,
|
| 65 |
+
inputs=["text"],
|
| 66 |
+
outputs="audio",
|
| 67 |
+
title="Convert text to audio",
|
| 68 |
+
description="An API for the user to convert text to audio"
|
| 69 |
+
)
|
| 70 |
+
genesis_app = gradio.TabbedInterface([health_check_gr, initialize_game_gr, play_game_gr, generate_image_prompt_gr, generate_audio_gr], ["Developers - Health Check", "Initialize game", "Play Game", "Generate Prompt for Leo", "Convert text to audio"])
|
| 71 |
genesis_app.launch()
|