sharktide commited on
Commit
214fdd3
·
verified ·
1 Parent(s): bc1a853

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -8,6 +8,7 @@ from bs4 import BeautifulSoup
8
  from typing import List, Dict
9
  import asyncio
10
  import re
 
11
  app = FastAPI()
12
 
13
  app.add_middleware(
@@ -451,7 +452,11 @@ async def generate_text(request: Request):
451
  stream = body.get("stream", False)
452
 
453
  if provider == "groq":
454
- API_KEY = os.getenv("GROQ_KEY", "")
 
 
 
 
455
  if not API_KEY:
456
  raise HTTPException(500, "Missing GROQ_KEY")
457
 
 
8
  from typing import List, Dict
9
  import asyncio
10
  import re
11
+ from random import randint
12
  app = FastAPI()
13
 
14
  app.add_middleware(
 
452
  stream = body.get("stream", False)
453
 
454
  if provider == "groq":
455
+ const num = randint(1, 2)
456
+ if num == 1:
457
+ API_KEY = os.getenv("GROQ_KEY", "")
458
+ elif num == 2:
459
+ API_KEY = os.getenv("GROQ2_KEY", "")
460
  if not API_KEY:
461
  raise HTTPException(500, "Missing GROQ_KEY")
462