Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -72,6 +72,13 @@ def readitaloud(result):
|
|
72 |
components.html(documentHTML5, width=800, height=300)
|
73 |
#return result
|
74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
# Chat and Chat with files
|
76 |
def chat_with_model(prompt, document_section, model_choice='gpt-3.5-turbo'):
|
77 |
model = model_choice
|
@@ -203,13 +210,6 @@ def extract_feature_and_detail(paragraph):
|
|
203 |
return header, detail
|
204 |
return None, None
|
205 |
|
206 |
-
def generate_filename(prompt, file_type):
|
207 |
-
central = pytz.timezone('US/Central')
|
208 |
-
safe_date_time = datetime.now(central).strftime("%m%d_%H%M")
|
209 |
-
replaced_prompt = prompt.replace(" ", "_").replace("\n", "_")
|
210 |
-
safe_prompt = "".join(x for x in replaced_prompt if x.isalnum() or x == "_")[:90]
|
211 |
-
return f"{safe_date_time}_{safe_prompt}.{file_type}"
|
212 |
-
|
213 |
def transcribe_audio(file_path, model):
|
214 |
key = os.getenv('OPENAI_API_KEY')
|
215 |
headers = {
|
|
|
72 |
components.html(documentHTML5, width=800, height=300)
|
73 |
#return result
|
74 |
|
75 |
+
def generate_filename(prompt, file_type):
|
76 |
+
central = pytz.timezone('US/Central')
|
77 |
+
safe_date_time = datetime.now(central).strftime("%m%d_%H%M")
|
78 |
+
replaced_prompt = prompt.replace(" ", "_").replace("\n", "_")
|
79 |
+
safe_prompt = "".join(x for x in replaced_prompt if x.isalnum() or x == "_")[:90]
|
80 |
+
return f"{safe_date_time}_{safe_prompt}.{file_type}"
|
81 |
+
|
82 |
# Chat and Chat with files
|
83 |
def chat_with_model(prompt, document_section, model_choice='gpt-3.5-turbo'):
|
84 |
model = model_choice
|
|
|
210 |
return header, detail
|
211 |
return None, None
|
212 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
def transcribe_audio(file_path, model):
|
214 |
key = os.getenv('OPENAI_API_KEY')
|
215 |
headers = {
|