marquesafonso commited on
Commit
c3fdd00
·
1 Parent(s): 08dffe9

fix env variable issue (2)

Browse files
Files changed (3) hide show
  1. main.py +2 -0
  2. requirements.txt +0 -0
  3. utils/transcriber.py +3 -0
main.py CHANGED
@@ -10,6 +10,8 @@ from fastapi.responses import HTMLResponse, Response
10
  from fastapi.security import HTTPBasic
11
  from pydantic import BaseModel, field_validator
12
 
 
 
13
  app = FastAPI()
14
  security = HTTPBasic()
15
 
 
10
  from fastapi.security import HTTPBasic
11
  from pydantic import BaseModel, field_validator
12
 
13
+ # TODO: fix .env issue
14
+
15
  app = FastAPI()
16
  security = HTTPBasic()
17
 
requirements.txt CHANGED
Binary files a/requirements.txt and b/requirements.txt differ
 
utils/transcriber.py CHANGED
@@ -1,10 +1,13 @@
1
  import os
 
2
  from gradio_client import Client, handle_file
3
 
4
  def transcriber(invideo_file:str, srt_file:str,
5
  max_words_per_line:int, task:str):
 
6
  HF_TOKEN = os.getenv("hf_token")
7
  HF_SPACE = os.getenv("hf_space")
 
8
  client = Client(HF_SPACE, hf_token=HF_TOKEN)
9
  result = client.predict(
10
  video_input=handle_file(invideo_file),
 
1
  import os
2
+ from dotenv import load_dotenv
3
  from gradio_client import Client, handle_file
4
 
5
  def transcriber(invideo_file:str, srt_file:str,
6
  max_words_per_line:int, task:str):
7
+ load_dotenv()
8
  HF_TOKEN = os.getenv("hf_token")
9
  HF_SPACE = os.getenv("hf_space")
10
+ print(HF_SPACE)
11
  client = Client(HF_SPACE, hf_token=HF_TOKEN)
12
  result = client.predict(
13
  video_input=handle_file(invideo_file),