matdmiller commited on
Commit
337790f
1 Parent(s): 46a82a9

fix audio file safari

Browse files
Files changed (2) hide show
  1. app.ipynb +11 -3
  2. app.py +2 -2
app.ipynb CHANGED
@@ -89,7 +89,7 @@
89
  "outputs": [],
90
  "source": [
91
  "#| export\n",
92
- "TEMP = os.environ['TEMP']\n",
93
  "TEMP_DIR = Path(TEMP)\n",
94
  "print('TEMP Dir:', TEMP_DIR)"
95
  ]
@@ -396,7 +396,7 @@
396
  "outputs": [],
397
  "source": [
398
  "#| export\n",
399
- "with gr.Blocks(title='OpenAI TTS', head='OpenAI TTS') as app:\n",
400
  " gr.Markdown(\"# OpenAI TTS\")\n",
401
  " gr.Markdown(\"\"\"Start typing below and then click **Go** to create the speech from your text. The current limit is 4,000 characters. \n",
402
  "For requests longer than 4,000 chars they will be broken into chunks of 4,000 or less chars automatically. [Spaces Link](https://matdmiller-tts-openai.hf.space/)\"\"\")\n",
@@ -487,7 +487,7 @@
487
  },
488
  {
489
  "cell_type": "code",
490
- "execution_count": 53,
491
  "id": "0420310d-930b-4904-8bd4-3458ad8bdbd3",
492
  "metadata": {},
493
  "outputs": [],
@@ -503,6 +503,14 @@
503
  "metadata": {},
504
  "outputs": [],
505
  "source": []
 
 
 
 
 
 
 
 
506
  }
507
  ],
508
  "metadata": {
 
89
  "outputs": [],
90
  "source": [
91
  "#| export\n",
92
+ "TEMP = os.environ['GRADIO_TEMP_DIR','/tmp/']\n",
93
  "TEMP_DIR = Path(TEMP)\n",
94
  "print('TEMP Dir:', TEMP_DIR)"
95
  ]
 
396
  "outputs": [],
397
  "source": [
398
  "#| export\n",
399
+ "with gr.Blocks(title='OpenAI TTS', head='OpenAI TTS', delete_cache=(3600,3600)) as app:\n",
400
  " gr.Markdown(\"# OpenAI TTS\")\n",
401
  " gr.Markdown(\"\"\"Start typing below and then click **Go** to create the speech from your text. The current limit is 4,000 characters. \n",
402
  "For requests longer than 4,000 chars they will be broken into chunks of 4,000 or less chars automatically. [Spaces Link](https://matdmiller-tts-openai.hf.space/)\"\"\")\n",
 
487
  },
488
  {
489
  "cell_type": "code",
490
+ "execution_count": 54,
491
  "id": "0420310d-930b-4904-8bd4-3458ad8bdbd3",
492
  "metadata": {},
493
  "outputs": [],
 
503
  "metadata": {},
504
  "outputs": [],
505
  "source": []
506
+ },
507
+ {
508
+ "cell_type": "code",
509
+ "execution_count": null,
510
+ "id": "4b4fe405-b58a-471f-9ce9-e52104012409",
511
+ "metadata": {},
512
+ "outputs": [],
513
+ "source": []
514
  }
515
  ],
516
  "metadata": {
app.py CHANGED
@@ -47,7 +47,7 @@ from tenacity import (
47
  ) # for exponential backoff
48
 
49
  # %% app.ipynb 4
50
- TEMP = os.environ['TEMP']
51
  TEMP_DIR = Path(TEMP)
52
  print('TEMP Dir:', TEMP_DIR)
53
 
@@ -253,7 +253,7 @@ def authorized(profile: gr.OAuthProfile=None) -> str:
253
  return None
254
 
255
  # %% app.ipynb 17
256
- with gr.Blocks(title='OpenAI TTS', head='OpenAI TTS') as app:
257
  gr.Markdown("# OpenAI TTS")
258
  gr.Markdown("""Start typing below and then click **Go** to create the speech from your text. The current limit is 4,000 characters.
259
  For requests longer than 4,000 chars they will be broken into chunks of 4,000 or less chars automatically. [Spaces Link](https://matdmiller-tts-openai.hf.space/)""")
 
47
  ) # for exponential backoff
48
 
49
  # %% app.ipynb 4
50
+ TEMP = os.environ['GRADIO_TEMP_DIR','/tmp/']
51
  TEMP_DIR = Path(TEMP)
52
  print('TEMP Dir:', TEMP_DIR)
53
 
 
253
  return None
254
 
255
  # %% app.ipynb 17
256
+ with gr.Blocks(title='OpenAI TTS', head='OpenAI TTS', delete_cache=(3600,3600)) as app:
257
  gr.Markdown("# OpenAI TTS")
258
  gr.Markdown("""Start typing below and then click **Go** to create the speech from your text. The current limit is 4,000 characters.
259
  For requests longer than 4,000 chars they will be broken into chunks of 4,000 or less chars automatically. [Spaces Link](https://matdmiller-tts-openai.hf.space/)""")