Spaces:
Runtime error
Runtime error
stefania11 commited on
Commit Β·
07e0495
1
Parent(s): 5f6b497
update app file
Browse files
app.py
CHANGED
|
@@ -15,6 +15,7 @@ pd.options.display.max_columns = 25
|
|
| 15 |
pd.options.display.max_rows = 300
|
| 16 |
|
| 17 |
stable_diffusion = gr.Blocks.load(name="spaces/stabilityai/stable-diffusion")
|
|
|
|
| 18 |
### ββββββββββββββββββββββββββββββββββββββββ
|
| 19 |
|
| 20 |
title="DataTeller"
|
|
@@ -28,6 +29,11 @@ def get_images(prompt):
|
|
| 28 |
gallery_dir = stable_diffusion(prompt, fn_index=2)
|
| 29 |
return [os.path.join(gallery_dir, img) for img in os.listdir(gallery_dir)]
|
| 30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
def magic_whisper_to_sd(audio, guidance_scale, nb_iterations, seed):
|
| 33 |
|
|
@@ -42,7 +48,7 @@ def generate_code(audio, guidance_scale, nb_iterations, seed):
|
|
| 42 |
|
| 43 |
whisper_results = translate(audio)
|
| 44 |
prompt = whisper_results[2]
|
| 45 |
-
code =
|
| 46 |
|
| 47 |
return code
|
| 48 |
|
|
@@ -333,7 +339,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 333 |
|
| 334 |
gr.Markdown(
|
| 335 |
"""
|
| 336 |
-
## 3. Use whisper results for
|
| 337 |
"""
|
| 338 |
)
|
| 339 |
with gr.Column():
|
|
@@ -397,18 +403,18 @@ with gr.Blocks(css=css) as demo:
|
|
| 397 |
# ax.annotate('{}'.format(p.get_height()), (p.get_x(), p.get_height()+1))
|
| 398 |
# return figure
|
| 399 |
|
| 400 |
-
|
| 401 |
-
|
| 402 |
-
|
| 403 |
-
|
| 404 |
-
|
| 405 |
-
|
| 406 |
-
|
| 407 |
-
|
| 408 |
-
|
| 409 |
-
|
| 410 |
-
|
| 411 |
-
|
| 412 |
|
| 413 |
|
| 414 |
gr.Markdown("""
|
|
|
|
| 15 |
pd.options.display.max_rows = 300
|
| 16 |
|
| 17 |
stable_diffusion = gr.Blocks.load(name="spaces/stabilityai/stable-diffusion")
|
| 18 |
+
code_generation=gr.Blocks.load(name="spaces/THUDM/CodeGeeX")
|
| 19 |
### ββββββββββββββββββββββββββββββββββββββββ
|
| 20 |
|
| 21 |
title="DataTeller"
|
|
|
|
| 29 |
gallery_dir = stable_diffusion(prompt, fn_index=2)
|
| 30 |
return [os.path.join(gallery_dir, img) for img in os.listdir(gallery_dir)]
|
| 31 |
|
| 32 |
+
def get_code(prompt):
|
| 33 |
+
examples_dir = code_generation(prompt, fn_index=2)
|
| 34 |
+
return [os.path.join(examples_dir, output) for output in os.listdir(examples_dir)]
|
| 35 |
+
|
| 36 |
+
|
| 37 |
|
| 38 |
def magic_whisper_to_sd(audio, guidance_scale, nb_iterations, seed):
|
| 39 |
|
|
|
|
| 48 |
|
| 49 |
whisper_results = translate(audio)
|
| 50 |
prompt = whisper_results[2]
|
| 51 |
+
code = get_code(prompt)
|
| 52 |
|
| 53 |
return code
|
| 54 |
|
|
|
|
| 339 |
|
| 340 |
gr.Markdown(
|
| 341 |
"""
|
| 342 |
+
## 3. Use whisper results for code generation
|
| 343 |
"""
|
| 344 |
)
|
| 345 |
with gr.Column():
|
|
|
|
| 403 |
# ax.annotate('{}'.format(p.get_height()), (p.get_x(), p.get_height()+1))
|
| 404 |
# return figure
|
| 405 |
|
| 406 |
+
# inputs = [
|
| 407 |
+
# gr.Dropdown(["Find Data Correlation", "Filter Correlation Data", "Business Travel vs Attrition", "Employee Experience vs Attrition", "Age vs Attrition",], label="Data Correlation and Visualization")
|
| 408 |
+
# ]
|
| 409 |
+
# outputs = gr.Plot()
|
| 410 |
+
|
| 411 |
+
# demo2 = gr.Interface(
|
| 412 |
+
# fn = outbreak,
|
| 413 |
+
# inputs = inputs,
|
| 414 |
+
# outputs = outputs,
|
| 415 |
+
# title="Employee-Experience: Data Correlation and Pattern Visualization",
|
| 416 |
+
# allow_flagging=False
|
| 417 |
+
# )
|
| 418 |
|
| 419 |
|
| 420 |
gr.Markdown("""
|