Nuno-Tome commited on
Commit
204a69d
·
2 Parent(s): 518e2cd 76d9b0d

Merge branch 'beta_feature/add_input_data' into develop

Browse files
Files changed (5) hide show
  1. README.md +1 -1
  2. app.py +1 -9
  3. app_old.py +27 -0
  4. app_old2.py +27 -0
  5. requirements.txt +1 -10
README.md CHANGED
@@ -4,7 +4,7 @@ emoji: 🗣🎙️
4
  colorFrom: gray
5
  colorTo: yellow
6
  sdk: gradio
7
- sdk_version: 4.21.0
8
  app_file: app.py
9
  pinned: false
10
  short_description: UNDER CONSTRUCTION
 
4
  colorFrom: gray
5
  colorTo: yellow
6
  sdk: gradio
7
+ sdk_version: 4.20.1
8
  app_file: app.py
9
  pinned: false
10
  short_description: UNDER CONSTRUCTION
app.py CHANGED
@@ -3,22 +3,14 @@ import json
3
 
4
  DEBUG_MODE = False
5
 
 
6
  def echo(text, request: gr.Request):
7
  output_text = {"report1": "SUCCESS"} # Initialize as a dictionary
8
  output_text["report2"] = "You inserted the text:"
9
  output_text["report3"] = text
10
  if request:
11
- if DEBUG_MODE:
12
- print("Request object:", request)
13
- print("Request headers dictionary:", request.headers)
14
- print("IP address:", request.client.host)
15
- print("Query parameters:", dict(request.query_params))
16
  # Convert headers to a dictionary and include them in the output_text
17
  output_text["headers"] = dict(request.headers.items())
18
- output_text["host"] = request.client.host
19
- output_text["query_params"] = dict(request.query_params)
20
- if DEBUG_MODE:
21
- print("Query parameters:", dict(request.query_params))
22
 
23
  # Convert the output_text dictionary to a JSON-formatted string
24
  output_text_json = json.dumps(output_text)
 
3
 
4
  DEBUG_MODE = False
5
 
6
+
7
  def echo(text, request: gr.Request):
8
  output_text = {"report1": "SUCCESS"} # Initialize as a dictionary
9
  output_text["report2"] = "You inserted the text:"
10
  output_text["report3"] = text
11
  if request:
 
 
 
 
 
12
  # Convert headers to a dictionary and include them in the output_text
13
  output_text["headers"] = dict(request.headers.items())
 
 
 
 
14
 
15
  # Convert the output_text dictionary to a JSON-formatted string
16
  output_text_json = json.dumps(output_text)
app_old.py ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import json
3
+
4
+ DEBUG_MODE = False
5
+
6
+ def echo(text, request: gr.Request):
7
+ output_text = {"report1": "SUCCESS"} # Initialize as a dictionary
8
+ output_text["report2"] = "You inserted the text:"
9
+ output_text["report3"] = text
10
+ if request:
11
+ if DEBUG_MODE:
12
+ print("Request object:", request)
13
+ print("Request headers dictionary:", request.headers)
14
+ print("IP address:", request.client.host)
15
+ print("Query parameters:", dict(request.query_params))
16
+ # Convert headers to a dictionary and include them in the output_text
17
+ output_text["headers"] = dict(request.headers.items())
18
+ output_text["host"] = request.client.host
19
+ output_text["query_params"] = dict(request.query_params)
20
+ if DEBUG_MODE:
21
+ print("Query parameters:", dict(request.query_params))
22
+
23
+ # Convert the output_text dictionary to a JSON-formatted string
24
+ output_text_json = json.dumps(output_text)
25
+ return output_text_json
26
+
27
+ io = gr.Interface(echo, "textbox", "json").launch(share=True)
app_old2.py ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import json
3
+
4
+ DEBUG_MODE = False
5
+
6
+ def echo(text, request: gr.Request):
7
+ output_text = {"report1": "SUCCESS"} # Initialize as a dictionary
8
+ output_text["report2"] = "You inserted the text:"
9
+ output_text["report3"] = text
10
+ if request:
11
+ if DEBUG_MODE:
12
+ print("Request object:", request)
13
+ print("Request headers dictionary:", request.headers)
14
+ print("IP address:", request.client.host)
15
+ print("Query parameters:", dict(request.query_params))
16
+ # Convert headers to a dictionary and include them in the output_text
17
+ output_text["headers"] = dict(request.headers.items())
18
+ output_text["host"] = request.client.host
19
+ output_text["query_params"] = dict(request.query_params)
20
+ if DEBUG_MODE:
21
+ print("Query parameters:", dict(request.query_params))
22
+
23
+ # Convert the output_text dictionary to a JSON-formatted string
24
+ output_text_json = json.dumps(output_text)
25
+ return output_text_json
26
+
27
+ io = gr.Interface(echo, "textbox", "json").launch(share=True)
requirements.txt CHANGED
@@ -1,11 +1,2 @@
1
  gradio
2
- transformers
3
- scipy
4
- spaces
5
- io
6
- os
7
- re
8
- torch
9
- torchaudio
10
- pathlib
11
- whisperspeech.pipeline
 
1
  gradio
2
+ transformers