TGPro1 commited on
Commit
4a982aa
·
1 Parent(s): 424d566

Expose Generate API

Browse files
Files changed (3) hide show
  1. app.py +4 -3
  2. deploy.bat +40 -0
  3. requirements.txt +2 -0
app.py CHANGED
@@ -20,8 +20,8 @@ VOICES = [
20
  ]
21
 
22
  # --- Rate Limiting Globals ---
23
- MAX_CHAR_LIMIT = 200 # Limit input characters for Free Tier
24
- COOLDOWN_SECONDS = 35 # 50s wait to ensure stability
25
  LAST_REQUEST_TIME = 0 # Tracks the last successful FREE generation time
26
 
27
  # THE TRAFFIC CONTROLLER
@@ -197,7 +197,8 @@ with gr.Blocks() as app:
197
  inputs=[prompt_input, voice_dropdown, emotion_input, random_seed_checkbox, seed_input, api_key_input],
198
  outputs=[audio_output, status_output],
199
  # Concurrency must be HIGH to allow Premium users to bypass sleeping Free users
200
- concurrency_limit=20
 
201
  )
202
 
203
  gr.Examples(
 
20
  ]
21
 
22
  # --- Rate Limiting Globals ---
23
+ MAX_CHAR_LIMIT = 50000 # Limit input characters for Free Tier
24
+ COOLDOWN_SECONDS = 0 # 50s wait to ensure stability (Modified by Agent: No Wait)
25
  LAST_REQUEST_TIME = 0 # Tracks the last successful FREE generation time
26
 
27
  # THE TRAFFIC CONTROLLER
 
197
  inputs=[prompt_input, voice_dropdown, emotion_input, random_seed_checkbox, seed_input, api_key_input],
198
  outputs=[audio_output, status_output],
199
  # Concurrency must be HIGH to allow Premium users to bypass sleeping Free users
200
+ concurrency_limit=20,
201
+ api_name="generate"
202
  )
203
 
204
  gr.Examples(
deploy.bat ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @echo off
2
+ echo ========================================================
3
+ echo DEPLOYMENT SCRIPT FOR UNLIMITED TTS SPACE
4
+ echo ========================================================
5
+ echo.
6
+ echo This script will deploy the modified code (Limit: 50,000 chars)
7
+ echo to your NEW Hugging Face Space.
8
+ echo.
9
+ echo PREREQUISITES:
10
+ echo 1. Create a NEW Space on Hugging Face (SDK: Gradio).
11
+ echo 2. Make sure you are logged in to Git or have your Access Token ready.
12
+ echo.
13
+ set /p SPACE_URL="Paste your NEW Space Git URL (e.g., https://huggingface.co/spaces/MyName/MySpace): "
14
+
15
+ if "%SPACE_URL%"=="" goto error
16
+
17
+ echo.
18
+ echo Updating Remote Origin...
19
+ git remote remove origin
20
+ git remote add origin %SPACE_URL%
21
+
22
+ echo.
23
+ echo Committing changes...
24
+ git add .
25
+ git commit -m "Unlimited Characters Patch (Agent)"
26
+
27
+ echo.
28
+ echo Pushing to new Space (Authentication may be required)...
29
+ git push --force -u origin main
30
+
31
+ echo.
32
+ echo ========================================================
33
+ echo DEPLOYMENT COMPLETE (Check for errors above)
34
+ echo ========================================================
35
+ pause
36
+ exit /b
37
+
38
+ :error
39
+ echo Error: URL cannot be empty.
40
+ pause
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ requests
2
+ gradio