Spaces:
Running
Running
burtenshaw
commited on
Commit
·
e3ca117
1
Parent(s):
aa0dd71
sort imports
Browse files- app/app.py +13 -12
- app/src/create_presentation.py +3 -2
- app/src/create_video.py +2 -2
- app/src/transcription_to_audio.py +7 -7
app/app.py
CHANGED
@@ -1,33 +1,34 @@
|
|
1 |
-
import
|
2 |
-
import requests
|
3 |
-
from bs4 import BeautifulSoup
|
4 |
import os
|
5 |
import re
|
|
|
|
|
6 |
import subprocess
|
7 |
import tempfile
|
8 |
-
import shutil
|
9 |
from pathlib import Path
|
10 |
-
|
|
|
|
|
|
|
11 |
from dotenv import load_dotenv
|
12 |
-
import shelve
|
13 |
|
14 |
# Import functions from your scripts (assuming they are structured appropriately)
|
15 |
# It's often better to refactor scripts into functions for easier import
|
16 |
try:
|
|
|
17 |
from src.create_presentation import (
|
18 |
-
generate_presentation_with_llm,
|
19 |
DEFAULT_LLM_MODEL,
|
20 |
DEFAULT_PRESENTATION_PROMPT_TEMPLATE,
|
|
|
21 |
)
|
22 |
-
from src.transcription_to_audio import text_to_speech, VOICE_ID
|
23 |
from src.create_video import (
|
24 |
-
|
|
|
25 |
convert_pdf_to_images,
|
26 |
create_video_clips,
|
27 |
-
|
28 |
-
cleanup_temp_files,
|
29 |
)
|
30 |
-
from
|
31 |
except ImportError as e:
|
32 |
print(f"Error importing script functions: {e}")
|
33 |
print("Please ensure scripts are in the 'src' directory and structured correctly.")
|
|
|
1 |
+
import logging
|
|
|
|
|
2 |
import os
|
3 |
import re
|
4 |
+
import shelve
|
5 |
+
import shutil
|
6 |
import subprocess
|
7 |
import tempfile
|
|
|
8 |
from pathlib import Path
|
9 |
+
|
10 |
+
import gradio as gr
|
11 |
+
import requests
|
12 |
+
from bs4 import BeautifulSoup
|
13 |
from dotenv import load_dotenv
|
|
|
14 |
|
15 |
# Import functions from your scripts (assuming they are structured appropriately)
|
16 |
# It's often better to refactor scripts into functions for easier import
|
17 |
try:
|
18 |
+
from huggingface_hub import InferenceClient
|
19 |
from src.create_presentation import (
|
|
|
20 |
DEFAULT_LLM_MODEL,
|
21 |
DEFAULT_PRESENTATION_PROMPT_TEMPLATE,
|
22 |
+
generate_presentation_with_llm,
|
23 |
)
|
|
|
24 |
from src.create_video import (
|
25 |
+
cleanup_temp_files,
|
26 |
+
concatenate_clips,
|
27 |
convert_pdf_to_images,
|
28 |
create_video_clips,
|
29 |
+
find_audio_files,
|
|
|
30 |
)
|
31 |
+
from src.transcription_to_audio import VOICE_ID, text_to_speech
|
32 |
except ImportError as e:
|
33 |
print(f"Error importing script functions: {e}")
|
34 |
print("Please ensure scripts are in the 'src' directory and structured correctly.")
|
app/src/create_presentation.py
CHANGED
@@ -1,8 +1,9 @@
|
|
|
|
1 |
import os
|
2 |
import re
|
3 |
-
from huggingface_hub import InferenceClient
|
4 |
import time
|
5 |
-
|
|
|
6 |
|
7 |
# Use the model ID specified in the script's default
|
8 |
DEFAULT_LLM_MODEL = "CohereLabs/c4ai-command-a-03-2025" # Model ID from the error log
|
|
|
1 |
+
import argparse
|
2 |
import os
|
3 |
import re
|
|
|
4 |
import time
|
5 |
+
|
6 |
+
from huggingface_hub import InferenceClient
|
7 |
|
8 |
# Use the model ID specified in the script's default
|
9 |
DEFAULT_LLM_MODEL = "CohereLabs/c4ai-command-a-03-2025" # Model ID from the error log
|
app/src/create_video.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
-
import os
|
2 |
-
import glob
|
3 |
import argparse
|
|
|
|
|
4 |
import sys
|
5 |
from typing import List, Tuple
|
6 |
|
|
|
|
|
|
|
1 |
import argparse
|
2 |
+
import glob
|
3 |
+
import os
|
4 |
import sys
|
5 |
from typing import List, Tuple
|
6 |
|
app/src/transcription_to_audio.py
CHANGED
@@ -13,19 +13,19 @@ This will:
|
|
13 |
4. Save audio files in {dir}/audio/{n}.wav format
|
14 |
"""
|
15 |
|
16 |
-
import re
|
17 |
-
import sys
|
18 |
-
import os
|
19 |
import argparse
|
20 |
-
import json
|
21 |
import hashlib
|
22 |
-
|
23 |
import logging
|
|
|
|
|
|
|
24 |
import time
|
25 |
-
import
|
26 |
|
27 |
-
from dotenv import load_dotenv
|
28 |
import fal_client
|
|
|
|
|
29 |
|
30 |
load_dotenv()
|
31 |
|
|
|
13 |
4. Save audio files in {dir}/audio/{n}.wav format
|
14 |
"""
|
15 |
|
|
|
|
|
|
|
16 |
import argparse
|
|
|
17 |
import hashlib
|
18 |
+
import json
|
19 |
import logging
|
20 |
+
import os
|
21 |
+
import re
|
22 |
+
import sys
|
23 |
import time
|
24 |
+
from pathlib import Path
|
25 |
|
|
|
26 |
import fal_client
|
27 |
+
import requests
|
28 |
+
from dotenv import load_dotenv
|
29 |
|
30 |
load_dotenv()
|
31 |
|