File size: 743 Bytes
026eb56
 
d5eb7c3
 
026eb56
d5eb7c3
5343b08
026eb56
 
 
 
f085ca0
026eb56
 
f085ca0
 
026eb56
 
 
 
946b1cd
026eb56
 
 
f085ca0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import gradio as gr
import json
#from bark import SAMPLE_RATE, generate_audio, preload_models
#from bark.generation import SUPPORTED_LANGS
#from share_btn imposrt community_icon_html, loading_icon_html, share_js
#from flask import Flask, jsonify
 
DEBUG_MODE = False



def echo(text, lang, request: gr.Request):
    output_text = {"report1": "SUCCESS"}  # Initialize as a dictionary
    output_text["report3"] = text
    
    
    if request:
        # Convert headers to a dictionary and include them in the output_text
        output_text["headers"] = dict(request.headers.items())
    

    output_text_json = json.dumps(output_text)
    return output_text_json

io = gr.Interface(echo, ["textarea", "textbox"], "json").launch(share=True)